<style>
    .excel-table{
        padding: 0 20px;
    }
    .excel-table table th{
        padding: 9px 0;
        background: #fafafa;
    }
    .excel-table table tr{
        border-bottom: 1px solid #f6f6f6;
    }
    .excel-table table td{
        padding: 5px 10px;
        text-align: center;
    }
    .excel-table table td input[type='number'] {
        text-align: center;
    }
    .excel-table table td input:disabled {
        background: #e3e3e3;
    }
    .excel-table table{
        border: 1px solid #f6f6f6;
    }
    .excel-title{
        font-weight: bold;
    }
    .excel-child-title{
        font-weight: bold;
        color: rgb(0,91,186);
    }
    .showPage-mask{
        position: absolute;
        z-index: 999;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0, 0.2);
        top: 0;
        left: 0;
        display: none;
    }
    .showPage-table{
        width: 90%;
        height: 100%;
        background: #fff;
    }
    .excel-title-red{
        color: red;
        font-weight: bold;
    }
    .btn_tool{
        display: flex;
        justify-content: space-between;
    }
</style>
<div class="layui-fluid layui-anim febs-anim" id="febs-activityContent" lay-title="活动内容">
    <div class="layui-row febs-container">
        <div class="layui-col-md12">
            <div class="layui-card">
                <button id="openShowPage" style="margin: 20px;" type="button" class="layui-btn layui-btn-xs">全活动周期</button>
                <!--input部分-->
                <div class="excel-table">
                    <table>
                        <thead>
                        <tr>
                            <th></th>
                            <th></th>
                            <th>#0柴油</th>
                            <th>#92汽油</th>
                            <th>#95汽油</th>
                            <th>合计</th>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="2">挂牌价（元/升）</td>
                                <td>
                                    <input id="0gpPrice" type="number" min="0" name="0price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="92gpPrice" type="number" min="0" name="92price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="95gpPrice" type="number" min="0" name="95price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">采购价（元/升）</td>
                                <td>
                                    <input id="0cgPrice" type="number" min="0" name="0price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="92cgPrice" type="number" min="0" name="92price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="95cgPrice" type="number" min="0" name="95price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">无活动单升折扣（元/升）</td>
                                <td>
                                    <input id="0salePer" type="number" min="0" name="0price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="92salePer" type="number" min="0" name="92price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="95salePer" type="number" min="0" name="95price" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">无活动单升毛利（元/升）</td>
                                <td>
                                    <input id="0profitPer" data-tdName="profitsNoL" disabled type="number" min="0" name="profitsNo0" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="92profitPer" data-tdName="profitsNoL" disabled type="number" min="0" name="profitsNo92" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                    <input id="95profitPer" data-tdName="profitsNoL" disabled type="number" min="0" name="profitsNo95" autocomplete="off" class="layui-input">
                                </td>
                                <td>
                                </td>
                            </tr>
                        </tbody>

                        <!--日均-->
                        <tbody>
                            <tr>
                                <td class="excel-title">日均加油车辆（辆）</td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0beforeOilCar" data-tdName="first" type="number" min="0" name="0before" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92beforeOilCar" data-tdName="first" type="number" min="0" name="92before" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95beforeOilCar" data-tdName="first" type="number" min="0" name="95before" autocomplete="off" class="layui-input first"></td>
                                <td><input data-tdName="countfirst" type="number" disabled name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0OilCar" data-tdName="second" type="number" min="0" name="0before" autocomplete="off" class="layui-input second"></td>
                                <td><input data-returnVal="92oilCar" data-car="92OilCar" data-tdName="second" type="number" min="0" name="92before" autocomplete="off" class="layui-input second"></td>
                                <td><input data-returnVal="95oilCar" data-car="95OilCar" data-tdName="second" type="number" min="0" name="95before" autocomplete="off" class="layui-input second"></td>
                                <td><input data-tdName="countsecond" type="number" disabled name="" autocomplete="off" class="layui-input countsecond"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0afterOilCar" data-tdName="third" type="number" min="0" name="0before" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92ilCar" data-car="92afterOilCar" data-tdName="third" type="number" min="0" name="92before" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95afterOilCar" data-tdName="third" type="number" min="0" name="95before" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countthird" type="number" disabled name="" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <!--单车加油量（升）-->
                            <tr>
                                <td colspan="2" class="excel-title">单车加油量（升）</td>
                                <td><input id="0oilAmountPer" data-tdName="singleOilL" type="number" min="0" name="0singleOil" autocomplete="off" class="layui-input"></td>
                                <td><input id="92oilAmountPer" data-tdName="singleOilL" type="number" min="0" name="92singleOil" autocomplete="off" class="layui-input"></td>
                                <td><input id="95oilAmountPer" data-tdName="singleOilL" type="number" min="0" name="95singleOil" autocomplete="off" class="layui-input"></td>
                                <td></td>
                            </tr>
                            <!--日均销量（升）-->
                            <tr>
                                <td class="excel-title">日均销量（升）</td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0beforeSaleNumber" data-tdName="avfirst" disabled type="number" min="0" name="0average" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="92beforeSaleNumber" data-tdName="avfirst" disabled type="number" min="0" name="92average" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95beforeSaleNumber" data-tdName="avfirst" disabled type="number" min="0" name="95average" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countavfirst" disabled type="number" name="count0" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0SaleNumber" data-tdName="avsecond" disabled type="number" min="0" name="0average" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="92SaleNumber" data-tdName="avsecond" disabled type="number" min="0" name="92average" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95SaleNumber" data-tdName="avsecond" disabled type="number" min="0" name="95average" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countavsecond" disabled type="number" name="count1" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0afterSaleNumber" data-tdName="avthird" disabled type="number" min="0" name="0average" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="92afterSaleNumber" data-tdName="avthird" disabled type="number" min="0" name="92average" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95afterSaleNumber" data-tdName="avthird" disabled type="number" min="0" name="95average" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countavthird" disabled type="number" name="count2" autocomplete="off" class="layui-input"></td>
                            </tr>
                        </tbody>

                        <!--预计活动日均-->
                        <tbody>
                            <tr><td></td></tr>
                            <tr>
                                <td class="excel-title">预计活动时日均加油车辆（辆）</td>
                            </tr>
                            <!--预计活动-日均车辆-->
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0exBeforeCar" data-tdName="firstexpect" type="number" min="0" name="0beforeexpect" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92exBeforeCar" data-tdName="firstexpect" type="number" min="0" name="92beforeexpect" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95exBeforeCar" data-tdName="firstexpect" type="number" min="0" name="95beforeexpect" autocomplete="off" class="layui-input first"></td>
                                <td><input data-tdName="countfirstexpect" type="number" disabled name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0exCar" id="expectCar0" data-tdName="secondexpect" type="number" min="0" name="0beforeexpect" autocomplete="off" class="layui-input second"></td>
                                <td><input data-returnVal="92oilCar" data-car="92exCar" id="expectCar92" data-tdName="secondexpect" type="number" min="0" name="92beforeexpect" autocomplete="off" class="layui-input second"></td>
                                <td><input data-returnVal="95oilCar" data-car="95exCar" id="expectCar95" data-tdName="secondexpect" type="number" min="0" name="95beforeexpect" autocomplete="off" class="layui-input second"></td>
                                <td><input data-tdName="countsecondexpect" type="number" disabled name="" autocomplete="off" class="layui-input countsecond"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0exAfterCar" data-tdName="thirdexpect" type="number" min="0" name="0beforeexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="0exAfterCar" data-tdName="thirdexpect" type="number" min="0" name="92beforeexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="0exAfterCar" data-tdName="thirdexpect" type="number" min="0" name="95beforeexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countthirdexpect" type="number" disabled name="" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2">预计活动期单车加油量（升）</td>
                                <td><input data-tdName="singleOilExpect" type="number" min="0" name="0singleOilexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="singleOilExpect" type="number" min="0" name="92singleOilexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="singleOilExpect" type="number" min="0" name="95singleOilexpect" autocomplete="off" class="layui-input"></td>
                                <td></td>
                            </tr>
                            <!--预计活动-日均销量-->
                            <tr>
                                <td class="excel-title">预计日均销量（升）</td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0exBeforeSale" data-tdName="avfirstexpect" disabled type="number" min="0" name="0averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="92exBeforeSale"  data-tdName="avfirstexpect" disabled type="number" min="0" name="92averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95exBeforeSale"  data-tdName="avfirstexpect" disabled type="number" min="0" name="95averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countavfirstexpect" disabled type="number" name="count0" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0exSale"  data-tdName="avsecondexpect" disabled type="number" min="0" name="0averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="92exSale" data-tdName="avsecondexpect" disabled type="number" min="0" name="92averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95exSale" data-tdName="avsecondexpect" disabled type="number" min="0" name="95averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countavsecondexpect" disabled type="number" name="count1" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0exAfterSale" data-tdName="avthirdexpect" disabled type="number" min="0" name="0averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="92oilCar" data-car="92exAfterSale" data-tdName="avthirdexpect" disabled type="number" min="0" name="92averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-returnVal="95oilCar" data-car="95exAfterSale" data-tdName="avthirdexpect" disabled type="number" min="0" name="95averageexpect" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="countavthirdexpect" disabled type="number" name="count2" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2" class="excel-title">宣传等物料投入（元）</td>
                                <td><input id="materialPrice" type="number" min="0" name="propaganda" autocomplete="off" class="layui-input"></td>
                            </tr>
                        </tbody>

                        <!--其中，直降,优惠券-->
                        <tbody>
                            <tr>
                                <td class="excel-title">其中：</td>
                            </tr>
                            <tr>
                                <td class="excel-child-title">A.直降</td>
                            </tr>
                            <tr>
                                <td colspan="2">直降金额（元/L)</td>
                                <td><input type="number" min="0" name="straightAmount" autocomplete="off" class="layui-input"></td>
                                <td><input type="number" min="0" name="straightAmount" autocomplete="off" class="layui-input"></td>
                                <td><input type="number" min="0" name="straightAmount" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td class="excel-child-title">B.优惠券</td>
                            </tr>
                            <tr>
                                <td colspan="2">预计单升折扣（元/L）</td>
                                <td><input id="0expectPerSale" type="number" min="0" name="expectSingleLiter" autocomplete="off" class="layui-input"></td>
                                <td><input id="92expectPerSale" type="number" min="0" name="expectSingleLiter" autocomplete="off" class="layui-input"></td>
                                <td><input id="95expectPerSale" type="number" min="0" name="expectSingleLiter" autocomplete="off" class="layui-input"></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td colspan="2">单车加油量（参考）</td>
                                <td><input disabled type="number" min="0" name="0referenceSingleCar" autocomplete="off" class="layui-input"></td>
                                <td><input disabled type="number" min="0" name="92referenceSingleCar" autocomplete="off" class="layui-input"></td>
                                <td><input disabled type="number" min="0" name="95referenceSingleCar" autocomplete="off" class="layui-input"></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td colspan="2">单升折扣（参考）</td>
                                <td><input id="0actualPerSale" disabled type="number" min="0" name="0referenceSingleDisCount" autocomplete="off" class="layui-input"></td>
                                <td><input id="92actualPerSale" disabled type="number" min="0" name="92referenceSingleDisCount" autocomplete="off" class="layui-input"></td>
                                <td><input id="95actualPerSale" disabled type="number" min="0" name="95referenceSingleDisCount" autocomplete="off" class="layui-input"></td>
                                <td></td>
                            </tr>
                            <tr><td>&nbsp;</td></tr>
                            <tr>
                                <td colspan="2">活动参与率（%）</td>
                                <td><input id="0activityPer" type="number" min="0" name="0activityRate" autocomplete="off" class="layui-input"></td>
                                <td><input id="92activityPer" type="number" min="0" name="92activityRate" autocomplete="off" class="layui-input"></td>
                                <td><input id="95activityPer" type="number" min="0" name="95activityRate" autocomplete="off" class="layui-input"></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="2">参与活动的人中，优惠券分配比例（%）：</td></tr>
                        </tbody>
                        <!--优惠券分配-->
                        <tbody id="couponsScale" class="coupons-scale"></tbody>
                        <!--优惠券明细-->
                        <tr><td colspan="2" class="excel-title">优惠券明细</td></tr>
                        <tbody id="couponsInfo"></tbody>
                        <!--免费赠品-->
                        <tr><td class="excel-child-title" colspan="2">C.免费赠品</td></tr>
                        <tr>
                            <td></td>
                            <td>名称</td>
                            <td>采购价（含税）</td>
                            <td>预计活动期内赠送数量</td>
                            <td>合计（元）</td>
                            <td>总计（元）</td>
                        </tr>
                        <tbody id="freebies">
                            <tr>
                                <td>赠品1</td>
                                <td><input type="text" name="freebiesName" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName='1freebies' type="number" min="0" name="freebiesPrice"  autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName='1freebies' type="number" min="0" name="freebiesExNumber" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName='1freebiesCount' disabled type="number" min="0" name="freebiesCount" autocomplete="off" class="layui-input"></td>
                                <td rowspan="12"><input id="giftTotal" data-tdName='freebiesTotal' disabled type="number" min="0" name="" autocomplete="off" class="layui-input"></td>
                            </tr>
                        </tbody>
                        <!--换购-->
                        <tr>
                            <td class="excel-child-title" colspan="2">D.换购</td>
                            <td class="excel-title">活动表现预测</td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>名称</td>
                            <td>原售价（含税）</td>
                            <td>换购价（含税）</td>
                            <td>采购价（含税）</td>
                            <td>无活动销量（个）</td>
                            <td>参加换购销量（个）</td>
                            <td>不参加换购销量（个）</td>
                        </tr>
                        <tbody id="changeProduct">
                            <tr>
                                <td colspan="2">新增折扣（含税）</td>
                                <td colspan="6"><input id="addSalePrice" disabled type="number" min="0" name="newDiscount" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td colspan="2">CR新增收入（含税）</td>
                                <td colspan="6"><input id="addInputPrice" disabled type="number" min="0" name="newCRIncome" autocomplete="off" class="layui-input"></td>
                            </tr>
                        </tbody>
                        <!--实际活动-日均加油-->
                        <tbody>
                            <tr><td></td></tr>
                            <tr><td class="excel-title">实际活动时日均加油车辆（辆）</td></tr>
                            <!--实际活动-->
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acBeforeOilCar" data-tdName="actualCarBefore" type="number" min="0" name="0actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acBeforeOilCar" data-tdName="actualCarBefore" type="number" min="0" name="92actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acBeforeOilCar" data-tdName="actualCarBefore" type="number" min="0" name="95actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-tdName="countactualCarBefore" type="number" disabled name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acOilCar" data-tdName="actualCar" type="number" min="0" name="0actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acOilCar" data-tdName="actualCar" type="number" min="0" name="92actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acOilCar" data-tdName="actualCar" type="number" min="0" name="95actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-tdName="countactualCar" type="number" disabled name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName">活动后: 2019.03.08-2019.03.31</td>
                                <td><input data-returnVal="0oilCar" data-car="0acAfterOilCar" data-tdName="actualCarAfter" type="number" min="0" name="0actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acAfterOilCar" data-tdName="actualCarAfter" type="number" min="0" name="92actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acAfterOilCar" data-tdName="actualCarAfter" type="number" min="0" name="95actualCar" autocomplete="off" class="layui-input first"></td>
                                <td><input data-tdName="countactualCarAfter" type="number" disabled name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr><td class="excel-title">实际活动时单车加油量（升）</td></tr>
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acBeforeOilNumber" data-tdName="actualOilBefore" type="number" min="0" name="0actualOil" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acBeforeOilNumber"  data-tdName="actualOilBefore" type="number" min="0" name="92actualOil" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acBeforeOilNumber"  data-tdName="actualOilBefore" type="number" min="0" name="95actualOil" autocomplete="off" class="layui-input first"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acOilNumber"  data-tdName="actualOil" type="number" min="0" name="0actualOil" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acOilNumber" data-tdName="actualOil" type="number" min="0" name="92actualOil" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acOilNumber" data-tdName="actualOil" type="number" min="0" name="95actualOil" autocomplete="off" class="layui-input first"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acAfterOilNumber" data-tdName="actualOilAfter" type="number" min="0" name="0actualOil" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acAfterOilNumber" data-tdName="actualOilAfter" type="number" min="0" name="92actualOil" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acAfterOilNumber" data-tdName="actualOilAfter" type="number" min="0" name="95actualOil" autocomplete="off" class="layui-input first"></td>
                            </tr>
                            <tr><td class="excel-title">实际活动时日均销量（升）</td></tr>
                            <tr>
                                <td colspan="2" data-tdName="beforeAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acBeforeSale" disabled data-tdName="actualSalesBefore" type="number" name="0actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acBeforeSale" disabled data-tdName="actualSalesBefore" type="number" name="92actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acBeforeSale" disabled data-tdName="actualSalesBefore" type="number" name="95actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input disabled data-tdName="countactualSalesBefore" type="number" name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="AcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acSale" disabled data-tdName="actualSales" type="number" name="0actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acSale" disabled data-tdName="actualSales" type="number" name="92actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acSale" disabled data-tdName="actualSales" type="number" name="95actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input disabled data-tdName="countactualSales" type="number" name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" data-tdName="afterAcName"></td>
                                <td><input data-returnVal="0oilCar" data-car="0acAfterSale" disabled data-tdName="actualSalesAfter" type="number" name="0actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="92oilCar" data-car="92acAfterSale" disabled data-tdName="actualSalesAfter" type="number" name="92actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input data-returnVal="95oilCar" data-car="95acAfterSale" disabled data-tdName="actualSalesAfter" type="number" name="95actualSales" autocomplete="off" class="layui-input first"></td>
                                <td><input disabled data-tdName="countactualSalesAfter" type="number" name="" autocomplete="off" class="layui-input countfirst"></td>
                            </tr>
                            <tr>
                                <td colspan="2" class="excel-title">宣传等物料投入(SP&A)</td>
                                <td><input type="number" min="0" name="propagandaSPA" autocomplete="off" class="layui-input"></td>
                            </tr>
                        </tbody>
                        <!--其中-->
                        <tbody>
                            <tr>
                                <td class="excel-title">其中：</td>
                            </tr>
                            <tr>
                                <td class="excel-child-title" colspan="2">A.直降合计（元）</td>
                                <td><input data-tdName="" type="number" min="0" name="straightTotal" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="" type="number" min="0" name="straightTotal" autocomplete="off" class="layui-input"></td>
                                <td><input data-tdName="" type="number" min="0" name="straightTotal" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td class="excel-child-title" colspan="2">B.优惠券合计（元）</td>
                                <td><input disabled data-tdName="couponTotal" type="number" min="0" name="0couponTotal" autocomplete="off" class="layui-input"></td>
                                <td><input disabled data-tdName="couponTotal" type="number" min="0" name="92couponTotal" autocomplete="off" class="layui-input"></td>
                                <td><input disabled data-tdName="couponTotal" type="number" min="0" name="95couponTotal" autocomplete="off" class="layui-input"></td>
                            </tr>
                        </tbody>
                        <!--优惠券合计-->
                        <tbody id="couponsCount">
                            <tr>
                                <td colspan="2"></td>
                                <td>使用数量</td>
                                <td>使用数量</td>
                                <td>使用数量</td>
                            </tr>
                        </tbody>
                        <!--赠品合计-->
                        <tbody id="freebiesCount">
                            <tr>
                                <td class="excel-child-title" colspan="2">C.赠品合计（SP&A)</td>
                                <td><input disabled data-tdName="" type="number" min="0" name="freebiesSum" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>名称</td>
                                <td>赠送数量</td>
                            </tr>
                        </tbody>
                        <!--换购合计-->
                        <tbody id="changeProductCount">
                            <tr>
                                <td class="excel-child-title" colspan="2">D.换购合计</td>
                                <td class="excel-title">CR</td>
                            </tr>
                            <tr>
                                <td class="excel-title" colspan="2">新增税前收入（元）</td>
                                <td><input disabled data-tdName="" type="number" min="0" name="changeProductIncome" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td class="excel-title" colspan="2">新增税前折扣（元）</td>
                                <td><input disabled data-tdName="" type="number" min="0" name="changeProductDiscount" autocomplete="off" class="layui-input"></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td>名称</td>
                                <td>参加换购销量（个）</td>
                                <td>不参加换购销量（个）</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <!--show page部分-->
                <div class="showPage-mask">
                    <div class="showPage-table excel-table">
                        <!--按钮栏-->
                        <div class="btn_tool">
                            <button id="showPageCalculate" type="button" class="layui-btn layui-btn-sm">计算</button>
                            <span shiro:hasPermission="shellActivityApplyDetail:add"><button id="showPageExcelSave" type="button" class="layui-btn layui-btn-sm">确认录入</button></span>
                            <button id="closeMask" style="background: transparent; color: #000;float: right;" type="button" class="layui-btn layui-btn-xs"><i class="layui-icon">&#x1006;</i></button>
                        </div>
                        <table>
                            <thead>
                                <tr>
                                    <th>全活动周期</th>
                                    <th>#0</th>
                                    <th>#92</th>
                                    <th>#95</th>
                                    <th>Total</th>
                                </tr>
                            </thead>
                            <!--基准情况-->
                            <tbody>
                                <tr>
                                    <td class="excel-title-red">1. 基准情况(BASE CASE SCENARIO )</td>
                                </tr>
                                <tr>
                                    <td>无活动日均车辆（辆）</td>
                                    <td>
                                        <input id="0basePerdayCar" disabled type="number" min="0" name="showPageNoActivityCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92basePerdayCar" disabled type="number" min="0" name="showPageNoActivityCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95basePerdayCar" disabled type="number" min="0" name="showPageNoActivityCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="baseTotalCar" disabled type="number" min="0" name="showPageNoActivityCarTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>无活动单加（升）</td>
                                    <td>
                                        <input id="0basePerlDay" disabled type="number" min="0" name="showPageNoActivityOil" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92basePerlDay" disabled type="number" min="0" name="showPageNoActivityOil" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95basePerlDay" disabled type="number" min="0" name="showPageNoActivityOil" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>无活动日均销量（升）</td>
                                    <td>
                                        <input id="0basePersaleA" disabled type="number" min="0" name="showPageNoActivitySale" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92basePersaleA" disabled type="number" min="0" name="showPageNoActivitySale" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95basePersaleA" disabled type="number" min="0" name="showPageNoActivitySale" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="baseTotalSale" disabled type="number" min="0" name="showPageNoActivitySaleTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>无活动时单升C3（元/升）</td>
                                    <td>
                                        <input id="0basePerc3Amo" disabled type="number" min="0" name="showPageNoActivityC3" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92basePerc3Amo" disabled type="number" min="0" name="showPageNoActivityC3" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95basePerc3Amo" disabled type="number" min="0" name="showPageNoActivityC3" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                            </tbody>
                            <!--促销情况-->
                            <tbody>
                                <tr>
                                    <td class="excel-title-red">2. 促销情况 (PROMOTION SCENARIO)</td>
                                </tr>
                                <tr>
                                    <td>有活动日均车辆（辆）</td>
                                    <td>
                                        <input id="0activityPerdayC" disabled type="number" min="0" name="showPageActivityHaveCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92activityPerdayC" disabled type="number" min="0" name="showPageActivityHaveCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95activityPerdayC" disabled type="number" min="0" name="showPageActivityHaveCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="activityTotalCar" disabled type="number" min="0" name="showPageActivityHaveCarToatl" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动期日均车辆（辆）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityCarTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>影响期日均车辆（辆）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageImpactCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageImpactCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageImpactCar" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageImpactCarTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动期单加（升）</td>
                                    <td>
                                        <input id="0activityPerlDay" disabled type="number" min="0" name="showPageActivitySingleOil" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92activityPerlDay" disabled type="number" min="0" name="showPageActivitySingleOil" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95activityPerlDay" disabled type="number" min="0" name="showPageActivitySingleOil" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>有活动日均销量（升）</td>
                                    <td>
                                        <input id="0activityPersaleAmount" disabled type="number" min="0" name="showPageActivitySale" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92activityPersaleAmount" disabled type="number" min="0" name="showPageActivitySale" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95activityPersaleAmount" disabled type="number" min="0" name="showPageActivitySale" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="activityTotalSale" disabled type="number" min="0" name="showPageActivitySaleTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>直降（元/升）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageStraightAmount" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageStraightAmount" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageStraightAmount" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>优惠券（元/升）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCoupons" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCoupons" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCoupons" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>有活动时单升C3（元/升）</td>
                                    <td>
                                        <input id="0activityPerc3Amount" disabled type="number" min="0" name="showPageActivityC3" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="92activityPerc3Amount" disabled type="number" min="0" name="showPageActivityC3" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input id="95activityPerc3Amount" disabled type="number" min="0" name="showPageActivityC3" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                            </tbody>
                            <!--促销KPI-->
                            <tbody>
                                <tr>
                                    <td class="excel-title-red">3. 促销KPI</td>
                                </tr>
                                <tr>
                                    <td>活动全周期（天）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityAllDays" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">销量贡献(KL)</td>
                                    <td>
                                        <input id="kpiSaleKl" disabled type="number" min="0" name="showPageSalesKL" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#0</td>
                                    <td>
                                        <input id="kpi0Kl" data-tdName="showPageKPIKL" disabled type="number" min="0" name="showPageSalesKL0" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#92</td>
                                    <td>
                                        <input id="kpi92Kl" data-tdName="showPageKPIKL"  disabled type="number" min="0" name="showPageSalesKL92" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#95</td>
                                    <td>
                                        <input id="kpi95Kl" data-tdName="showPageKPIKL"  disabled type="number" min="0" name="showPageSalesKL95" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">C3贡献(KRMB)</td>
                                    <td>
                                        <input id="kpiSaleC3" disabled type="number" min="0" name="showPageKRMBC3" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#0</td>
                                    <td>
                                        <input id="kpi0C3" disabled type="number" min="0" name="showPageKRMB0" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#92</td>
                                    <td>
                                        <input id="kpi92C3" disabled type="number" min="0" name="showPageKRMB92" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#95</td>
                                    <td>
                                        <input id="kpi95C3" disabled type="number" min="0" name="showPageKRMB95" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---NFR</td>
                                    <td>
                                        <input id="nfr" disabled type="number" min="0" name="showPageNFR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">直降</td>
                                    <td>
                                        <input id="directDown" data-tdName="showPageCostChild" disabled type="number" min="0" name="showPageStraightKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">优惠券</td>
                                    <td>
                                        <input id="coupons" data-tdName="showPageCostChild" disabled type="number" min="0" name="showPageCouponsKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">换购折扣</td>
                                    <td>
                                        <input id="repurchase" data-tdName="showPageCostChild" disabled type="number" min="0" name="showPageChangeDiscount" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">赠品（SP&A)</td>
                                    <td>
                                        <input id="gifts" data-tdName="showPageCostChild" disabled type="number" min="0" name="showPageGiftsKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">宣传等物料投入(SP&A)</td>
                                    <td>
                                        <input id="materielPrice" data-tdName="showPageCostChild" disabled type="number" min="0" name="showPagePropagandaKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title-red">净利润</td>
                                    <td>
                                        <input id="netProfit" disabled type="number" min="0" name="showPageNetProfitKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title-red">总成本</td>
                                    <td>
                                        <input id="totalCost" disabled type="number" min="0" name="showPageCostTotalKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>ROI</td>
                                    <td class="excel-title-red">
                                        <input id="roi" disabled type="number" min="0" name="showPageROIKPI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                            </tbody>
                            <!--PIR-->
                            <tbody>
                                <tr>
                                    <td class="excel-title-red">4. PIR</td>
                                </tr>
                                <tr>
                                    <td>活动期间日均车辆（辆）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCarDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCarDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCarDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageCarDailyPIRTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动前后日均车辆（辆）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeCarDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeCarDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeCarDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeCarDailyPIRTotal" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动期间单加（升）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSingleOilPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSingleOilPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSingleOilPIR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动前后单加（升）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeSingleOilPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeSingleOilPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageBeforeSingleOilPIR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动全周期日均销量（升）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSaleDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSaleDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSaleDailyPIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSaleDailyPIRToatl" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>有活动时单升C3（元/升）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityC3PIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityC3PIR" autocomplete="off" class="layui-input">
                                    </td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageActivityC3PIR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>活动全周期（天）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageAllDaysPIR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">销量贡献（KL）</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSalesKLPIR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#0</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSalesKLPIR0" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#92</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSalesKLPIR92" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#95</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPageSalesKLPIR95" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">C3贡献(KRMB)</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRKRMBC3" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#0</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRKRMB0" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#92</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRKRMB92" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---#95</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRKRMB95" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td>---NFR</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRNFR" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">直降</td>
                                    <td>
                                        <input data-tdName="showPagePIRCostChild" disabled type="number" min="0" name="showPagePIRStraight" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">优惠券</td>
                                    <td>
                                        <input data-tdName="showPagePIRCostChild" disabled type="number" min="0" name="showPagePIRCoupons" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">换购折扣</td>
                                    <td>
                                        <input data-tdName="showPagePIRCostChild" disabled type="number" min="0" name="showPagePIRChange" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">赠品（SP&A)</td>
                                    <td>
                                        <input data-tdName="showPagePIRCostChild" disabled type="number" min="0" name="showPagePIRGifts" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title">宣传等物料投入(SP&A)</td>
                                    <td>
                                        <input data-tdName="showPagePIRCostChild" disabled type="number" min="0" name="showPagePIRPropagandaSPA" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title-red">净利润</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRNetProfit" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title-red">总成本(KRMB)</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRTotalCost" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="excel-title-red">ROI</td>
                                    <td>
                                        <input disabled type="number" min="0" name="showPagePIRROI" autocomplete="off" class="layui-input">
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <p id="acId" style="display: none;" th:text="${acId}"></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script data-th-inline="none" type="text/javascript">
    layui.use(['jquery', 'laydate', 'form', 'table', 'febs', 'formSelects'], function () {
        var $ = layui.jquery,
            febs = layui.febs,
            form = layui.form,
            table = layui.table,
            dropdown = layui.dropdown,
            formSelects = layui.formSelects,
            idac = $("#acId").text(),
            acId = null,
            actID = parseInt(idac),
            activityString = {},
            infoCount = 8,//
            freeCount = 12,//优惠券
            changeCount = 12,//换购品
            activityDays = 0,//活动期
            activityBeforeDays = 0,//活动前影响天数
            activityAfterDays = 0,//活动后影响天数
            activityAllDays = 0,//活动全周期影响天数
            $view = $('#febs-activityContent');


        //详情-获取
        getContentInfo();

        //添加优惠券比例分配
        couponsScaleHtml();
        //添加优惠券明细
        couponsInfoHtml();
        //免费赠品
        freebiesHtml();
        //换购
        changeProductHtml();
        //优惠券合计
        couponsCountHtml();
        //赠品合计
        freebiesCountHtml();
        //换购品合计
        changeProductCountHtml();
        // 绑定事件 type=number
        $("input[type = 'number']").bind("input onkeyup",function(event){
            //循环输出绑定-优惠券明细,优惠券合计
            for (var i =0; i < infoCount; i++) {
                var index = i + 1;
                var name = index+"lowPrice";
                var disName = index + "disAmount";
                switch (this.dataset.tdname) {
                    case name:
                        discountFunc(name);
                        break;
                    case disName:
                        discountFunc(disName);
                        break;
                    default:
                        break;
                }
            }
            //循环输出绑定-免费赠品
            for (var i =0; i < 12; i++) {
                var index = i + 1;
                var name = index+"freebies";
                switch (this.dataset.tdname) {
                    case name:
                        freebiesProductFunc(name);
                        break;
                    default:
                        break;
                }
            }
            //tdname
            switch (this.dataset.tdname) {
                case 'first':
                    priceCountFunc('first');
                    break;
                case 'second':
                    priceCountFunc('second');
                    break;
                case 'third':
                    priceCountFunc('third');
                    break;
                case 'firstexpect':
                    priceCountFunc('firstexpect');
                    break;
                case 'secondexpect':
                    priceCountFunc('secondexpect');
                    break;
                case 'thirdexpect':
                    priceCountFunc('thirdexpect');
                    break;
                case 'actualCarBefore':
                    priceCountFunc('actualCarBefore');
                    break;
                case 'actualCar':
                    priceCountFunc('actualCar');
                    break;
                case 'actualCarAfter':
                    priceCountFunc('actualCarAfter');
                    break;
                default:
                    break;
            }
            //name
            switch (this.name) {
                case '0before':
                    priceProductFunc(this.name);
                    break;
                case '92before':
                    priceProductFunc(this.name);
                    break;
                case '95before':
                    priceProductFunc(this.name);
                    break;
                case '0price':
                    pricePoorFunc(this.name);
                    break;
                case '92price':
                    pricePoorFunc(this.name);
                    break;
                case '95price':
                    pricePoorFunc(this.name);
                    break;
                case '0singleOil':
                    priceProductFunc(this.name);
                    break;
                case '92singleOil':
                    priceProductFunc(this.name);
                    break;
                case '95singleOil':
                    priceProductFunc(this.name);
                    break;
                case '0singleOilexpect':
                    priceProductExpectFunc(this.name);
                    break;
                case '92singleOilexpect':
                    priceProductExpectFunc(this.name);
                    break;
                case '95singleOilexpect':
                    priceProductExpectFunc(this.name);
                    break;
                case 'oldPrice'://原售价
                    changeProductDisCount(this.name);
                    break;
                case 'changePrice'://换购价
                    changeProductDisCount(this.name);
                    break;
                case 'changeSales'://参加换购销量
                    changeProductDisCount(this.name);
                    break;
                case 'purchasePrice'://采购价
                    changeProductIncome(this.name);
                    break;
                case 'salesNo'://无活动销量
                    changeProductIncome(this.name);
                    break;
                case 'changeSalesNo'://不参加换购销量
                    changeProductIncome(this.name);
                    break;
                case '0actualCar': //实际活动-车辆-0
                    actualSalesFunc('0actualCar');
                    break;
                case '92actualCar': //实际活动-车辆-92
                    actualSalesFunc('92actualCar');
                    break;
                case '95actualCar': //实际活动-车辆-95
                    actualSalesFunc('95actualCar');
                    break;
                case '0actualOil': //实际活动-加油量-0
                    actualSalesFunc('0actualOil');
                    break;
                case '92actualOil': //实际活动-加油量-92
                    actualSalesFunc('92actualOil');
                    break;
                case '95actualOil': //实际活动-加油量-95
                    actualSalesFunc('95actualOil');
                    break;
                case '0disAmount': //优惠券明细-优惠金额-0
                    couponsCountFunc('0disAmount');
                    break;
                case '92disAmount': //优惠券明细-优惠金额-92
                    couponsCountFunc('92disAmount');
                    break;
                case '95disAmount': //优惠券明细-优惠金额-95
                    couponsCountFunc('95disAmount');
                    break;
                case '0useNumber'://优惠券使用数量-0
                    couponsCountFunc('0useNumber');
                    break;
                case '92useNumber'://优惠券使用数量-92
                    couponsCountFunc('92useNumber');
                    break;
                case '95useNumber'://优惠券使用数量-95
                    couponsCountFunc('95useNumber');
                    break;
                case 'freebiesNumber': //赠品数量
                    freebiesCountFunc();
                    break;
                case 'freebiesPrice': //赠品价格
                    freebiesCountFunc();
                    break;
                case 'changeProductSale'://换购合计-新增税前折扣
                    changeProductCountPretax();
                    break;
                case 'changeProductSaleNo': //换购合计-新增税前收入
                    changeProductIncomePretax();
                    break;
                case '0activityRate'://活动参与率-0
                    oliCarDaily('0activityRate');
                    break;
                case '92activityRate'://活动参与率-92
                    oliCarDaily('92activityRate');
                    break;
                case '95activityRate'://活动参与率-95
                    oliCarDaily('95activityRate');
                    break;
                case '0CouponRatio'://优惠券分配比例-0
                    oliCarDaily('0CouponRatio');
                    break;
                case '92CouponRatio'://优惠券分配比例-92
                    oliCarDaily('92CouponRatio');
                    break;
                case '95CouponRatio'://优惠券分配比例-95
                    oliCarDaily('95CouponRatio');
                    break;
                case '0beforeexpect': //预计活动日均加油车辆
                    oliCarDaily('0beforeexpect');
                    break;
                case '92beforeexpect': //预计活动日均加油车辆
                    oliCarDaily('92beforeexpect');
                    break;
                case '95beforeexpect': //预计活动日均加油车辆
                    oliCarDaily('95beforeexpect');
                    break;
                case '0lowPriceYuan': //最低消费金额-0
                    oliCarDaily('0lowPriceYuan');
                    break;
                case '92lowPriceYuan': //最低消费金额-92
                    oliCarDaily('92lowPriceYuan');
                    break;
                case '95lowPriceYuan': //最低消费金额-95
                    oliCarDaily('95lowPriceYuan');
                    break;
                default:
                    break;
            }
        });
        // 绑定事件 type=text
        $("input[type = 'text']").bind("input onkeyup", function (event) {
            switch (this.name) {
                case 'freebiesName'://免费赠品名称
                    freebiesNameFunc('freebiesName');
                    break;
                case "changeName":
                    changeProductNameFunc('changeName');
                    break;
                default:
                    break;
            }
        });
        //绑定事件-打开弹窗
        $("#openShowPage").on('click', function () {
            $('.showPage-mask').css('display', 'block');
        });
        //绑定事件-关闭弹窗
        $("#closeMask").on('click', function () {
            $('.showPage-mask').css('display', 'none');
        });
        //绑定事件-showPage计算
        $("#showPageCalculate").on('click', function () {
            showPageActivityNoCar();
            showPageSalesPromotion();
            showPageSalesKpi();
            showPagePIR();
        });

        // 横向求和
        function priceCountFunc(name) {
            var sum = 0;
            var total = 0;
            $("[data-tdName='"+name+"']").each(function() {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                sum += v*100;
            });
            $("[data-tdName=count"+name+"]").val(sum/100);//小计
        }
        // 竖直求差
        function pricePoorFunc(name) {
            var num = parseInt(name);
            var poor = 0, arr=[];
            $("[name='"+name+"']").each(function () {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                arr.push(v)
            });
            poor = arr.reduce(function (item,prev) {
                item = item*100 - prev*100;
                return item/100
            });
            $("[name='profitsNo"+num+"']").val(poor);
            discountFunc()
        }
        //平均日价-求积
        function priceProductFunc(name) {
            //name 0singleOil 92singleOil 95singleOil 98singleOil
            var single0 = parseFloat($("[name = 0singleOil]").val()),
                single92 = parseFloat($("[name = 92singleOil]").val()),
                single95 = parseFloat($("[name = 95singleOil]").val()),
                num = parseInt(name), beforeArr = [];
            if (num == 0) {
                $("[name = 0before]").each(function() {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (single0) {
                        beforeArr.push(v * single0);
                        $("[name = 0average]").each(function (index,value) {
                            $(this).val(beforeArr[index])
                        })
                        priceCountFunc('avfirst');
                        priceCountFunc('avsecond');
                        priceCountFunc('avthird');
                    }
                });
            } else if (num == 92) {
                $("[name = 92before]").each(function() {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (single92) {
                        beforeArr.push(v * single92);
                        $("[name = 92average]").each(function (index,value) {
                            $(this).val(beforeArr[index])
                        })
                        priceCountFunc('avfirst');
                        priceCountFunc('avsecond');
                        priceCountFunc('avthird');
                    }
                });
            } else {
                $("[name = 95before]").each(function() {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (single95) {
                        beforeArr.push(v * single95);
                        $("[name = 95average]").each(function (index,value) {
                            $(this).val(beforeArr[index])
                        })
                        priceCountFunc('avfirst');
                        priceCountFunc('avsecond');
                        priceCountFunc('avthird');
                    }
                });
            }
            oliCarDaily(name)
        }
        // 预计-平均日价-求积
        function priceProductExpectFunc(name) {
            var single0 = parseFloat($("[name = 0singleOilexpect]").val()),
                single92 = parseFloat($("[name = 92singleOilexpect]").val()),
                single95 = parseFloat($("[name = 95singleOilexpect]").val()),
                num = parseInt(name), beforeArr = [];
            if (num == 0) {
                $("[name = 0beforeexpect]").each(function() {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (single0) {
                        beforeArr.push(v * single0);
                        $("[name = 0averageexpect]").each(function (index,value) {
                            $(this).val(beforeArr[index])
                        });
                        priceCountFunc('avfirstexpect');
                        priceCountFunc('avsecondexpect');
                        priceCountFunc('avthirdexpect');
                        oliCarDaily('0beforeexpect')
                    }
                });
            } else if (num == 92) {
                $("[name = 92beforeexpect]").each(function() {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (single92) {
                        beforeArr.push(v * single92);
                        $("[name = 92averageexpect]").each(function (index,value) {
                            $(this).val(beforeArr[index])
                        });
                        priceCountFunc('avfirstexpect');
                        priceCountFunc('avsecondexpect');
                        priceCountFunc('avthirdexpect');
                        oliCarDaily('92beforeexpect')
                    }
                });
            } else {
                $("[name = 95beforeexpect]").each(function() {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (single95) {
                        beforeArr.push(v * single95);
                        $("[name = 95averageexpect]").each(function (index,value) {
                            $(this).val(beforeArr[index])
                        })
                        priceCountFunc('avfirstexpect');
                        priceCountFunc('avsecondexpect');
                        priceCountFunc('avthirdexpect');
                        oliCarDaily('95beforeexpect')
                    }
                });
            }
        }
        //优惠券明细-折扣计算
        function discountFunc(name) {
            //获取挂牌价
            var price0 = $('#0gpPrice').val(),
                price92 = $('#92gpPrice').val(),
                price95 = $('#95gpPrice').val(),
                priceArr = [], amountArr = [];
            if (name) {
                var num = parseInt(name);
                $("[data-tdName="+num+"lowPrice]").each(function(index) {
                    v = parseFloat($(this).val());
                    v = isNaN(v)?0:v;
                    if (index == 0) {
                        v = v / price0
                    } else if (index == 1) {
                        v = v / price92
                    } else {
                        v = v / price95
                    }
                    priceArr.push(v)
                });
                //最低单车加油量-赋值
                $("[data-tdName="+num+"lowOil]").each(function (index) {
                    $(this).val(priceArr[index].toFixed(2))
                });
                //优惠金额-获取
                $("[data-tdName="+num+"disAmount]").each(function (index) {
                    d = parseFloat($(this).val());
                    d = isNaN(d)?0:d;
                    if (index == 0) {
                        d = d / priceArr[0]
                    } else if (index == 1) {
                        d = d / priceArr[1]
                    } else {
                        d = d / priceArr[2]
                    }
                    amountArr.push(d)
                });
                //折扣-赋值
                $("[data-tdName="+num+"discount]").each(function (index) {
                    $(this).val(amountArr[index].toFixed(2))
                });
                oliCarDaily(name)

            } else {
                console.log('被触发了')
            }
        }
        //赠品-合计
        function freebiesProductFunc(name) {
            var num = parseInt(name), arr = [], total = [], sum = 0;
            $("[data-tdName="+num+"freebies]").each(function () {
                d = parseFloat($(this).val());
                d = isNaN(d)?0:d;
                arr.push(d*100)
            });
            $("[data-tdName="+num+"freebiesCount]").each(function () {
                var count = arr[0] * arr[1] / 10000;
                $(this).val(count.toFixed(2));
            });
            $("[name=freebiesCount]").each(function () {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                sum += v*100;
            });
            $("[data-tdName=freebiesTotal]").val(sum/100)
        }
        //换购-新增折扣
        function changeProductDisCount() {
            var oldPriceArr = [], changePriceArr = [], changeSalesArr = [], sum=0,sumChange=0;
            //原售价
            $("[name=oldPrice]").each(function (index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                oldPriceArr.push(v);
            });
            //换购价
            $("[name=changePrice]").each(function () {
                c = parseFloat($(this).val());
                c = isNaN(c)?0:c;
                changePriceArr.push(c);
            });
            //换购销量
            $("[name=changeSales]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                changeSalesArr.push(s);
            });
            //原售价*换购销量的和
            for (var i = 0; i < oldPriceArr.length;i++) {
                sum += oldPriceArr[i] * changeSalesArr[i];
            }
            //换购价*换购销量的和
            for (var j = 0; j < changePriceArr.length;j++) {
                sumChange += changePriceArr[j] * changeSalesArr[j];
            }
            var val = sum - sumChange;
            $('[name = newDiscount]').val(val.toFixed(2));
            changeProductIncome();
            changeProductCountPretax();
            changeProductIncomePretax();
        }
        //换购-CR新增收入
        function changeProductIncome() {
            var oldPriceArr = [],
                changeSalesArr = [],
                changeSalesNoArr = [],
                purchasePriceArr = [],
                salesNoArr = [],
                oldChange=0,
                oldChangeNo=0,
                purchaseChange=0,
                purchaseChangeNo=0,
                oldNo=0, purchaseNo=0;
            //原售价
            $("[name=oldPrice]").each(function (index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                oldPriceArr.push(v);
            });
            //参加换购销量
            $("[name=changeSales]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                changeSalesArr.push(s);
            });
            // 不参加换购销量
            $("[name=changeSalesNo]").each(function () {
                n = parseFloat($(this).val());
                n = isNaN(n)?0:n;
                changeSalesNoArr.push(n);
            });
            //采购价
            $("[name=purchasePrice]").each(function () {
                p = parseFloat($(this).val());
                p = isNaN(p)?0:p;
                purchasePriceArr.push(p);
            });
            //无活动销量
            $("[name=salesNo]").each(function () {
                sn = parseFloat($(this).val());
                sn = isNaN(sn)?0:sn;
                salesNoArr.push(sn);
            });
            //原售价*参加换购销量的和
            for (var i = 0; i < oldPriceArr.length;i++) {
                oldChange += oldPriceArr[i] * changeSalesArr[i];
                oldNo += oldPriceArr[i] * salesNoArr[i];
                oldChangeNo += oldPriceArr[i] * changeSalesNoArr[i];
            }
            //采购价 * 参加换购销量的和
            for (var h = 0; h < purchasePriceArr.length;h++) {
                purchaseChange += purchasePriceArr[h] * changeSalesArr[h];
                purchaseChangeNo += purchasePriceArr[h] * changeSalesNoArr[h];
                purchaseNo += purchasePriceArr[h] * salesNoArr[h];
            }
            var val = oldChange + oldChangeNo - purchaseChange - purchaseChangeNo - (oldNo - purchaseNo);
            $('[name=newCRIncome]').val(val.toFixed(2));
            changeProductIncomePretax();
        }
        //实际活动-日均销量
        function actualSalesFunc(name) {
                var num = parseInt(name),
                    actualCar = '',
                    actualOil = '',
                    actualSales = '',
                    carArr = [],
                    oilArr = [],
                    saleArr = [];
            if (num == 0) {
                actualCar = '0actualCar';
                actualOil = '0actualOil';
                actualSales = '0actualSales';
            } else if (num == 92) {
                actualCar = '92actualCar';
                actualOil = '92actualOil';
                actualSales = '92actualSales';
            } else {
                actualCar = '95actualCar';
                actualOil = '95actualOil';
                actualSales = '95actualSales';
            }
            //车辆
            $("[name="+actualCar+"]").each(function() {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                carArr.push(v);
            });
            //加油量
            $("[name="+actualOil+"]").each(function() {
                o = parseFloat($(this).val());
                o = isNaN(o)?0:o;
                oilArr.push(o);
            });
            //车辆*加油量
            for (var i = 0; i < carArr.length; i++) {
                var val = carArr[i] * oilArr[i];
                saleArr.push(val.toFixed(2))
            }
            $("[name = "+actualSales+"]").each(function (index,value) {
                $(this).val(saleArr[index])
                priceCountFunc('actualSalesBefore');
                priceCountFunc('actualSales');
                priceCountFunc('actualSalesAfter');
            });
        }
        //优惠券合计-计算
        function couponsCountFunc(name) {
            var num = parseInt(name),
                sum = 0,
                numberArr = [],
                couponsArr = [],
                countArr = [];
            //优惠券数量
            $("[name="+num+"useNumber]").each(function () {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                numberArr.push(v)
            });
            //优惠金额
            $("[name="+num+"disAmount]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                couponsArr.push(s)
            });
            // 优惠券数量*优惠金额
            for (var i = 0; i < numberArr.length; i++) {
                sum += numberArr[i] * couponsArr[i];
            }
            //赋值
            $("[name="+num+"couponTotal]").val(sum.toFixed(2));
        }
        //赠品-名称赋值
        function freebiesNameFunc(name) {
            var nameArr = [];
            $("[name="+name+"]").each(function () {
                v = $(this).val();
                nameArr.push(v)
            });
            $("[name=freebiesCountName]").each(function (index) {
                $(this).val(nameArr[index])
            });
        }
        //赠品合计-计算
        function freebiesCountFunc(name) {
            var numberArr = [],
                priceArr = [],
                sum=0;
            //赠品数量
            $("[name=freebiesNumber]").each(function () {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                numberArr.push(v)
            });
            //赠品采购价
            $("[name=freebiesPrice]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                priceArr.push(s)
            });
            //赠品数量*赠品采购价
            for (var i=0; i<numberArr.length;i++) {
                sum += numberArr[i] * priceArr[i]
            }
            $('[name = freebiesSum]').val(sum)
        }
        //换购品-名称赋值
        function changeProductNameFunc(name) {
            var nameArr = [];
            $("[name="+name+"]").each(function () {
                v = $(this).val();
                nameArr.push(v)
            });
            $("[name=changeProductName]").each(function (index) {
                $(this).val(nameArr[index])
            });
        }
        //换购合计-新增税前收入
        function changeProductIncomePretax() {
            var oldPriceArr = [],
                changeSalesArr = [],
                changeSalesNoArr = [],
                purchasePriceArr = [],
                salesNoArr = [],
                oldChange=0,
                oldChangeNo=0,
                purchaseChange=0,
                purchaseChangeNo=0,
                oldNo=0, purchaseNo=0;
            //原售价
            $("[name=oldPrice]").each(function (index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                oldPriceArr.push(v);
            });
            //参加换购销量
            $("[name=changeProductSale]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                changeSalesArr.push(s);
            });
            // 不参加换购销量
            $("[name=changeProductSaleNo]").each(function () {
                n = parseFloat($(this).val());
                n = isNaN(n)?0:n;
                changeSalesNoArr.push(n);
            });
            //采购价
            $("[name=purchasePrice]").each(function () {
                p = parseFloat($(this).val());
                p = isNaN(p)?0:p;
                purchasePriceArr.push(p);
            });
            //无活动销量
            $("[name=salesNo]").each(function () {
                sn = parseFloat($(this).val());
                sn = isNaN(sn)?0:sn;
                salesNoArr.push(sn);
            });
            //原售价*参加换购销量的和
            for (var i = 0; i < oldPriceArr.length;i++) {
                oldChange += oldPriceArr[i] * changeSalesArr[i];
                oldNo += oldPriceArr[i] * salesNoArr[i];
                oldChangeNo += oldPriceArr[i] * changeSalesNoArr[i];
            }
            //采购价 * 参加换购销量的和
            for (var h = 0; h < purchasePriceArr.length;h++) {
                purchaseChange += purchasePriceArr[h] * changeSalesArr[h];
                purchaseChangeNo += purchasePriceArr[h] * changeSalesNoArr[h];
                purchaseNo += purchasePriceArr[h] * salesNoArr[h];
            }
            var val = oldChange + oldChangeNo - purchaseChange - purchaseChangeNo - (oldNo - purchaseNo);
            $('[name=changeProductIncome]').val(val.toFixed(2))
        }
        //换购合计-新增税前折扣
        function changeProductCountPretax() {
            var oldPriceArr = [],
                changePriceArr = [],
                changeSalesArr = [],
                sum=0,sumChange=0;
            //原售价
            $("[name=oldPrice]").each(function (index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                oldPriceArr.push(v);
            });
            //换购价
            $("[name=changePrice]").each(function () {
                c = parseFloat($(this).val());
                c = isNaN(c)?0:c;
                changePriceArr.push(c);
            });
            //换购销量
            $("[name=changeProductSale]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                changeSalesArr.push(s);
            });
            //原售价*换购销量的和
            for (var i = 0; i < oldPriceArr.length;i++) {
                sum += oldPriceArr[i] * changeSalesArr[i];
            }
            //换购价*换购销量的和
            for (var j = 0; j < changePriceArr.length;j++) {
                sumChange += changePriceArr[j] * changeSalesArr[j];
            }
            var val = sum - sumChange;
            $('[name = changeProductDiscount]').val(val.toFixed(2));
            changeProductIncomePretax()
        }
        //单车加油量（参考）
        function oliCarDaily(name) {
            var num = parseInt(name),
                expect = 0,//活动期预计日均加油车辆
                activityRate=0,//活动参与率
                singleOil=0,//单车加油量
                couponRatio="",//优惠券分配比例
                lowOilNumber ="",//优惠券最低单车加油量
                ratioArr = [],
                numberArr = [],
                sum = 0,
                referenceSingleCar="";//单车加油量（参考）

            if (num == 0){
                expect = $("#expectCar0").val();
                activityRate = ($("[name=0activityRate]").val()) / 100;
                singleOil = parseFloat($("[name=0singleOil]").val());
                couponRatio = "0CouponRatio";
                lowOilNumber = "0lowOilNumber";
                referenceSingleCar = "0referenceSingleCar";
            } else if (num == 92) {
                expect = $("#expectCar92").val();
                activityRate = ($("[name=92activityRate]").val()) / 100;
                singleOil = parseFloat($("[name=92singleOil]").val());
                couponRatio = "92CouponRatio";
                lowOilNumber = "92lowOilNumber";
                referenceSingleCar = "92referenceSingleCar";
            } else {
                expect = $("#expectCar95").val();
                activityRate = ($("[name=95activityRate]").val()) / 100;
                singleOil = parseFloat($("[name=95singleOil]").val());
                couponRatio = "95CouponRatio";
                lowOilNumber = "95lowOilNumber";
                referenceSingleCar = "95referenceSingleCar";
            }
            //优惠券分配比例
            $("[name="+couponRatio+"]").each(function (index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                ratioArr.push(v/100);
            });
            // 优惠券最低单车加油量
            $("[name="+lowOilNumber+"]").each(function (index) {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                numberArr.push(s);
            });
            //优惠券分配比例 * 优惠券最低单车加油量
            for (var i=0; i<ratioArr.length; i++) {
                sum += ratioArr[i] * numberArr[i]
            }
            var val = (expect * (1 - activityRate) * singleOil + expect * activityRate * sum) / expect;
            $("[name="+referenceSingleCar+"]").val(val.toFixed(2));
            singleLiterDiscount(name)
        }
        //单升折扣（参考）
        function singleLiterDiscount(name) {
            var num = parseInt(name),
                expect = 0,//活动期预计日均加油车辆
                activityRate=0,//活动参与率
                couponRatio="",//优惠券分配比例
                discoutAmount = '',//优惠金额
                ratioArr = [],
                amountArr = [],
                sum = 0,
                referenceSingleDisCount="",//单升折扣（参考）
                referenceSingleCar="";//单车加油量（参考）
            if (num == 0){
                expect = $("#expectCar0").val();
                activityRate = ($("[name=0activityRate]").val()) / 100;
                couponRatio = "0CouponRatio";
                discoutAmount = "0disAmount";
                referenceSingleCar = $("[name=0referenceSingleCar]").val();
                referenceSingleDisCount = "0referenceSingleDisCount";
            } else if (num == 92) {
                expect = $("#expectCar92").val();
                activityRate = ($("[name=92activityRate]").val()) / 100;
                couponRatio = "92CouponRatio";
                discoutAmount = "92disAmount";
                referenceSingleCar = $("[name=92referenceSingleCar]").val();
                referenceSingleDisCount = "92referenceSingleDisCount"
            } else {
                expect = $("#expectCar95").val();
                activityRate = ($("[name=95activityRate]").val()) / 100;
                couponRatio = "95CouponRatio";
                discoutAmount = "95disAmount";
                referenceSingleCar = $("[name=95referenceSingleCar]").val();
                referenceSingleDisCount = "95referenceSingleDisCount"
            }

            //优惠券分配比例
            $("[name="+couponRatio+"]").each(function (index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                ratioArr.push(v/100);
            });
            // 优惠金额
            $("[name="+discoutAmount+"]").each(function (index) {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                amountArr.push(s);
            });
            //优惠券分配比例*优惠金额
            for (var i=0; i<ratioArr.length; i++) {
                sum += ratioArr[i] * amountArr[i]
            }
            var val = expect * activityRate * sum / (expect * referenceSingleCar);
            $("[name="+referenceSingleDisCount+"]").val(val.toFixed(2));
        }

        //循环输出-优惠券分配比例
        function couponsScaleHtml() {
            var _html = '';
            for (var i = 0; i < 8; i++) {
                var index = i + 1;
                _html += "<tr>"+
                            "<td colspan=\"2\">券"+index+"</td>"+
                            "<td><input type=\"number\" min=\"0\" name=\"0CouponRatio\" autocomplete=\"off\" class=\"layui-input\"></td>"+
                            "<td><input type=\"number\" min=\"0\" name=\"92CouponRatio\" autocomplete=\"off\" class=\"layui-input\"></td>"+
                            "<td><input type=\"number\" min=\"0\" name=\"95CouponRatio\" autocomplete=\"off\" class=\"layui-input\"></td>"+
                            "<td></td>"+
                        "</tr>"
            }
            $("#couponsScale").append(_html)
        }
        //循环输出-优惠券明细
        function couponsInfoHtml() {
            var _html = "";
            for (var i = 0; i < infoCount; i++) {
                var index = i + 1;
                _html += "<tr><td>&nbsp;</td>></tr>><tr>\n" +
                            "<td rowspan=\"4\">券"+index+"</td>\n" +
                            "<td>最低消费金额（元）</td>\n" +
                            "<td><input data-tdName='"+index+"lowPrice' type=\"number\" min=\"0\" name=\'0lowPriceYuan\' autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"lowPrice' type=\"number\" min=\"0\" name=\'92lowPriceYuan\' autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"lowPrice' type=\"number\" min=\"0\" name=\'95lowPriceYuan\' autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td></td>\n" +
                        "</tr>\n" +
                        "<tr>\n" +
                            "<td>优惠金额（元）</td>\n" +
                            "<td><input data-tdName='"+index+"disAmount' type=\"number\" min=\"0\" name=\'0disAmount\' autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"disAmount' type=\"number\" min=\"0\" name=\'92disAmount\' autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"disAmount' type=\"number\" min=\"0\" name=\'95disAmount\' autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td></td>\n" +
                        "</tr>\n" +
                        "<tr>\n" +
                            "<td>折扣（元/升）</td>\n" +
                            "<td><input data-tdName='"+index+"discount' disabled type=\"number\" min=\"0\" name=\"0discount\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"discount' disabled type=\"number\" min=\"0\" name=\"92discount\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"discount' disabled type=\"number\" min=\"0\" name=\"95discount\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td></td>\n" +
                        "</tr>\n" +
                        "<tr>\n" +
                            "<td>最低单车加油量（升）</td>\n" +
                            "<td><input data-tdName='"+index+"lowOil' disabled type=\"number\" min=\"0\" name=\"0lowOilNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"lowOil' disabled type=\"number\" min=\"0\" name=\"92lowOilNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"lowOil' disabled type=\"number\" min=\"0\" name=\"95lowOilNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td></td>\n" +
                        "</tr>"
            }
            $("#couponsInfo").append(_html)
        }
        //循环输出-免费赠品
        function freebiesHtml() {
            var _html = "";
            for (var i = 0; i < 11; i++) {
                var index = i + 2;
                _html += "<tr>\n" +
                            "<td>赠品"+index+"</td>\n" +
                            "<td><input type=\"text\" name=\"freebiesName\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"freebies' type=\"number\" min=\"0\" name=\"freebiesPrice\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"freebies' type=\"number\" min=\"0\" name=\"freebiesExNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input disabled data-tdName='"+index+"freebiesCount' type=\"number\" min=\"0\" name=\"freebiesCount\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                        "</tr>"
            }
            $('#freebies').append(_html)
        }
        //循环输出-换购
        function changeProductHtml() {
            var _html = '';
            for (var i = 0; i < changeCount; i ++) {
                var index = i + 1;
                _html += "<tr>\n" +
                            "<td>换购品"+index+"</td>\n" +
                            "<td><input type=\"text\" name=\"changeName\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"changeProduct' type=\"number\" min=\"0\" name=\"oldPrice\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"changeProduct' type=\"number\" min=\"0\" name=\"changePrice\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"changeProduct' type=\"number\" min=\"0\" name=\"purchasePrice\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"changeProduct' type=\"number\" min=\"0\" name=\"salesNo\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"changeProduct' type=\"number\" min=\"0\" name=\"changeSales\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='"+index+"changeProduct' type=\"number\" min=\"0\" name=\"changeSalesNo\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                        "</tr>"
            }
            $("#changeProduct").prepend(_html)
        }
        //循环输出-优惠券合计
        function couponsCountHtml() {
            var _html = "";
            for (var i = 0; i < infoCount; i++) {
                var index = i + 1;
                _html += "<tr>\n" +
                            "<td colspan=\"2\">券"+index+"</td>\n" +
                            "<td><input data-tdName='' type=\"number\" min=\"0\" name=\"0useNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='' type=\"number\" min=\"0\" name=\"92useNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName='' type=\"number\" min=\"0\" name=\"95useNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                        "</tr>"
            }
            $("#couponsCount").append(_html)
        }
        //循环输出-赠品合计
        function freebiesCountHtml() {
            var _html = "";
            for (var i = 0; i < freeCount; i++) {
                var index = i + 1;
                _html += "<tr>\n" +
                            "<td>赠品"+index+"</td>\n" +
                            "<td><input disabled data-tdName=\"\" type=\"text\" name=\"freebiesCountName\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName=\"\" type=\"number\" min=\"0\" name=\"freebiesNumber\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                        "</tr>"
            }
            $("#freebiesCount").append(_html)
        }
        //循环输出-换购合计
        function changeProductCountHtml() {
            var _html = "";
            for (var i = 0; i < changeCount; i++) {
                var index = i + 1;
                _html += "<tr>\n" +
                            "<td>换购品"+index+"</td>\n" +
                            "<td><input disabled data-tdName=\"\" type=\"text\" min=\"0\" name=\"changeProductName\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName=\"\" type=\"number\" min=\"0\" name=\"changeProductSale\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                            "<td><input data-tdName=\"\" type=\"number\" min=\"0\" name=\"changeProductSaleNo\" autocomplete=\"off\" class=\"layui-input\"></td>\n" +
                        "</tr>"
            }
            $("#changeProductCount").append(_html)
        }

        //showPage里的方法
        
        //基准情况-计算
        function showPageActivityNoCar() {
            var beforeArr = [],//活动前日均车辆
                arr = [],//活动期日均车辆
                afterArr = [],//活动后日均车辆
                sum = 0,//日均车辆total
                oilArr = [], //无活动单升
                carArr = [],//无活动日均车辆
                saleSum = 0,//无活动日均销量total
                profitsArr = [],//无活动单升毛利
                activitySum = 0,//活动期日均车辆总数
                impactArr = [],//影响期日均车辆
                impactSum = 0,//影响期日均车辆总数
                expectOilArr=[];//预计活动期单车加油量
            //活动前日均车辆
            $("[data-tdName=first]").each(function(index) {
                f = parseFloat($(this).val());
                f = isNaN(f)?0:f;
                var c = f * activityBeforeDays;
                beforeArr.push(c)
            });
            //活动期日均车辆
            $("[data-tdName=second]").each(function(index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                var c = v * activityDays;
                arr.push(c)
            });
            //活动后日均车辆
            $("[data-tdName=third]").each(function(index) {
                t = parseFloat($(this).val());
                t = isNaN(t)?0:t;
                var c = t * activityAfterDays;
                afterArr.push(c)
            });
            //无活动日均车辆-赋值
            $("[name=showPageNoActivityCar]").each(function (index) {
                var val = (beforeArr[index] + arr[index] + afterArr[index]) / activityAllDays;
                $(this).val(val);
                carArr.push(val);
                sum += val
            });
            // 无活动日均车辆total-赋值
            $("[name=showPageNoActivityCarTotal]").val(sum.toFixed(2));

            //无活动单加（升）-赋值
            $("[data-tdName=singleOilL]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                oilArr.push(s)
            });
            $("[name=showPageNoActivityOil]").each(function (index) {
                $(this).val(oilArr[index])
            });
            //无活动日均销量-赋值
            $("[name=showPageNoActivitySale]").each(function (index) {
                var saleVal = carArr[index] * oilArr[index];
                $(this).val(saleVal);
                saleSum += saleVal
            });
            //无活动日均销量total-赋值
            $("[name=showPageNoActivitySaleTotal]").val(saleSum.toFixed(2));
            //无活动单升毛利
            $("[data-tdName=profitsNoL]").each(function (index) {
                p = parseFloat($(this).val());
                p = isNaN(p)?0:p;
                p = p/1.16;
                profitsArr.push(p.toFixed(2))
            });
            //无活动时单升C3（元/升）
            $("[name=showPageNoActivityC3]").each(function (index) {
                $(this).val(profitsArr[index])
            });
        }
        //促销情况-计算
        function showPageSalesPromotion() {
            var beforeArr = [],//活动前日均车辆
                arr = [],//活动期日均车辆
                afterArr = [],//活动后日均车辆
                oilArr = [], //无活动单升
                haveCarSum = 0,//有活动日均车辆总数
                activitySum = 0,//活动期日均车辆总数
                impactArr = [],//影响期日均车辆
                impactSum = 0,//影响期日均车辆总数
                saleSum = 0,//有活动日均销量总数
                expectOilArr=[],//预计活动期单车加油量
                straightArr = [],//直降金额
                expectLiterArr=[],//预计单升折扣
                straightAmountArr=[],//直降
                couponsArr=[],//优惠券
                noActivityC3Arr=[];//无活动单升c3
            //活动前日均车辆
            $("[data-tdName=first]").each(function(index) {
                f = parseFloat($(this).val());
                f = isNaN(f)?0:f;
                beforeArr.push(f)
            });
            //活动期日均车辆
            $("[data-tdName=second]").each(function(index) {
                v = parseFloat($(this).val());
                v = isNaN(v)?0:v;
                arr.push(v)
            });
            //活动后日均车辆
            $("[data-tdName=third]").each(function(index) {
                t = parseFloat($(this).val());
                t = isNaN(t)?0:t;
                afterArr.push(t)
            });
            //直降金额
            $("[name=straightAmount]").each(function () {
                a = parseFloat($(this).val());
                a = isNaN(a)?0:a;
                straightArr.push(a)
            });
            //预计活动期单车加油量,活动期单加
            $("[data-tdName=singleOilExpect]").each(function () {
                e = parseFloat($(this).val());
                e = isNaN(e)?0:e;
                expectOilArr.push(e)
            });
            //预计单升折扣
            $("[name=expectSingleLiter]").each(function () {
                l = parseFloat($(this).val());
                l = isNaN(l)?0:l;
                expectLiterArr.push(l)
            });
            //无活动单升c3
            $("[name=showPageNoActivityC3]").each(function () {
                z = parseFloat($(this).val());
                z = isNaN(z)?0:z;
                noActivityC3Arr.push(z)
            });
            //无活动单加（升）-赋值
            $("[data-tdName=singleOilL]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                oilArr.push(s)
            });
            //促销活动-活动期日均车辆
            $("[name=showPageActivityCar]").each(function (index) {
                $(this).val(arr[index]);
                activitySum += arr[index]
            });
            //促销活动-活动期日均车辆-总数
            $("[name=showPageActivityCarTotal]").val(activitySum.toFixed(2));
            //促销活动-影响期日均车辆
            $("[name=showPageImpactCar]").each(function (index) {
                var val = (beforeArr[index] * activityBeforeDays + afterArr[index] * activityAfterDays) / (activityBeforeDays + activityAfterDays)
                $(this).val(val.toFixed(2));
                impactArr.push(val.toFixed(2));
                impactSum += val
            });
            //促销活动-影响期日均车辆-总数
            $("[name=showPageImpactCarTotal]").val(impactSum);
            //促销活动-有活动日均车辆
            $("[name=showPageActivityHaveCar]").each(function (index) {
                var val = (arr[index] * activityDays + impactArr[index] * (activityBeforeDays + activityAfterDays)) / activityAllDays;
                $(this).val(val.toFixed(2));
                haveCarSum += val
            });
            //促销活动-有活动日均车辆-总数
            $("[name=showPageActivityHaveCarToatl]").val(haveCarSum.toFixed(2));
            //促销活动-活动期单加
            $("[name=showPageActivitySingleOil]").each(function (index) {
                $(this).val(oilArr[index])
            });
            //促销活动-有活动日均销量
            $("[name=showPageActivitySale]").each(function (index) {
                var val = (arr[index] * oilArr[index] * activityDays + impactArr[index] * oilArr[index] * (activityAllDays - activityDays)) / activityAllDays
                $(this).val(val.toFixed(2));
                saleSum += val
            });
            //促销活动-有活动日均销量Total
            $("[name=showPageActivitySaleTotal]").val(saleSum.toFixed(2));
            //直降
            $("[name=showPageStraightAmount]").each(function (index) {
                var val = straightArr[index] / 1.16;
                $(this).val(val.toFixed(2));
                straightAmountArr.push(val)
            });
            //优惠券
            $("[name=showPageCoupons]").each(function (index) {
                var val = expectLiterArr[index] / 1.16;
                $(this).val(val.toFixed(2));
                couponsArr.push(val)
            });
            //有活动时单升C3
            $("[name=showPageActivityC3]").each(function (index) {
                var val = noActivityC3Arr[index] - (straightAmountArr[index] + couponsArr[index]);
                $(this).val(val.toFixed(2))
            })

        }
        //促销kpi-计算
        function showPageSalesKpi() {
            var activitySaleArr=[],//有活动日均销量
                noActivitySaleArr=[],//无活动日均销量
                KPIKLSum = 0,//kpi销量贡献KL
                exBeforeSaleDailyArr=[],//活动前预计日均销量
                exSaleDailyArr=[],//活动期预计日均销量
                exAfterSaleDailyArr=[],//活动后预计日均销量
                beforeSaleDailyArr=[],//活动前日均销量
                saleDailyArr=[],//活动期日均销量
                afterSaleDailyArr=[],//活动前日均销量
                noActivityC3Arr=[],//无活动时c3
                activityC3Arr=[],//有活动c3
                KPIKRMBKL=0,//KPI-C3贡献(KRMB)
                straightArr=[],//直降金额
                straightSum=0,
                exSingleLiterArr=[],//预计单升折扣
                singleLiterSum=0;


            //有活动日均销量
            $("[name=showPageActivitySale]").each(function () {
                s = parseFloat($(this).val());
                s = isNaN(s)?0:s;
                activitySaleArr.push(s)
            });
            //无活动日均销量
            $("[name=showPageNoActivitySale]").each(function () {
                n = parseFloat($(this).val());
                n = isNaN(n)?0:n;
                noActivitySaleArr.push(n)
            });
            //活动前预计日均销量
            $("[data-tdName=avfirstexpect]").each(function () {
                first = parseFloat($(this).val());
                first = isNaN(first)?0:first;
                exBeforeSaleDailyArr.push(first)
            });
            //活动期预计日均销量
            $("[data-tdName=avsecondexpect]").each(function () {
                second = parseFloat($(this).val());
                second = isNaN(second)?0:second;
                exSaleDailyArr.push(second)
            });
            //活动后预计日均销量
            $("[data-tdName=avthirdexpect]").each(function () {
                third = parseFloat($(this).val());
                third = isNaN(third)?0:third;
                exAfterSaleDailyArr.push(third)
            });
            //活动前日均销量
            $("[data-tdName=avfirst]").each(function () {
                avfirst = parseFloat($(this).val());
                avfirst = isNaN(avfirst)?0:avfirst;
                beforeSaleDailyArr.push(avfirst)
            });
            //活动期日均销量
            $("[data-tdName=avsecond]").each(function () {
                avsecond = parseFloat($(this).val());
                avsecond = isNaN(avsecond)?0:avsecond;
                saleDailyArr.push(avsecond)
            });
            //活动后日均销量
            $("[data-tdName=avthird]").each(function () {
                avthird = parseFloat($(this).val());
                avthird = isNaN(avthird)?0:avthird;
                afterSaleDailyArr.push(avthird)
            });
            //无活动单升c3
            $("[name=showPageNoActivityC3]").each(function () {
                z = parseFloat($(this).val());
                z = isNaN(z)?0:z;
                noActivityC3Arr.push(z)
            });
            //有活动单升c3
            $("[name=showPageActivityC3]").each(function () {
                c = parseFloat($(this).val());
                c = isNaN(c)?0:c;
                activityC3Arr.push(c)
            });
            //直降金额
            $("[name=straightAmount]").each(function () {
                sa = parseFloat($(this).val());
                sa = isNaN(sa)?0:sa;
                straightArr.push(sa)
            });
            //预计单升折扣
            $("[name=expectSingleLiter]").each(function () {
                sl = parseFloat($(this).val());
                sl = isNaN(sl)?0:sl;
                exSingleLiterArr.push(sl)
            });
            //活动全周期
            $("[name=showPageActivityAllDays]").val(activityAllDays);
            //销量贡献-0
            var zeroKl = (activitySaleArr[0] - noActivitySaleArr[0]) * activityAllDays / 1000;
            $("[name=showPageSalesKL0]").val(zeroKl.toFixed(2));
            //销量贡献-92
            var nineTwoKL = (activitySaleArr[1] - noActivitySaleArr[1]) * activityAllDays / 1000;
            $("[name=showPageSalesKL92]").val(nineTwoKL.toFixed(2));
            //销量贡献-95
            var nineFiveKL = (activitySaleArr[2] - noActivitySaleArr[2]) * activityAllDays / 1000;
            $("[name=showPageSalesKL95]").val(nineFiveKL.toFixed(2));
            //销量贡献-kl
            KPIKLSum = zeroKl + nineTwoKL + nineFiveKL;
            $("[name=showPageSalesKL]").val(KPIKLSum.toFixed(2));
            //C3贡献(KRMB)-0
            var KRMB0 = ((exBeforeSaleDailyArr[0] - beforeSaleDailyArr[0]) * noActivityC3Arr[0] * activityBeforeDays + (exAfterSaleDailyArr[0] - afterSaleDailyArr[0]) * noActivityC3Arr[0] * activityAfterDays + (exSaleDailyArr[0] * activityC3Arr[0] - saleDailyArr[0] * noActivityC3Arr[0]) * activityDays) / 1000
            $("[name=showPageKRMB0]").val(KRMB0.toFixed(2));
            //C3贡献(KRMB)-92
            var KRMB92 = ((exBeforeSaleDailyArr[1] - beforeSaleDailyArr[1]) * noActivityC3Arr[1] * activityBeforeDays + (exAfterSaleDailyArr[1] - afterSaleDailyArr[1]) * noActivityC3Arr[1] * activityAfterDays + (exSaleDailyArr[1] * activityC3Arr[1] - saleDailyArr[1] * noActivityC3Arr[1]) * activityDays) / 1000
            $("[name=showPageKRMB92]").val(KRMB92.toFixed(2));
            //C3贡献(KRMB)-95
            var KRMB95 = ((exBeforeSaleDailyArr[2] - beforeSaleDailyArr[2]) * noActivityC3Arr[2] * activityBeforeDays + (exAfterSaleDailyArr[2] - afterSaleDailyArr[2]) * noActivityC3Arr[2] * activityAfterDays + (exSaleDailyArr[2] * activityC3Arr[2] - saleDailyArr[2] * noActivityC3Arr[2]) * activityDays) / 1000
            $("[name=showPageKRMB95]").val(KRMB95.toFixed(2));
            //C3贡献(KRMB)
            KPIKRMBKL = KRMB0 + KRMB92 + KRMB95;
            $("[name=showPageKRMBC3]").val(KPIKRMBKL.toFixed(2));
            //NFR
            var income = $("[name=changeProductIncome]").val(),
            discount = $("[name=changeProductDiscount]").val();
            var nfr = ((income - discount) / 1.16) / 1000;
            $("[name=showPageNFR]").val(nfr.toFixed(2));
            //直降
            for (var i = 0; i < exSaleDailyArr.length; i++) {
                straightSum += exSaleDailyArr[i] * straightArr[i]
            }
            var kpiStright = (-straightSum * activityDays / 1.13) / 1000;
            $("[name=showPageStraightKPI]").val(kpiStright.toFixed(2));
            //优惠券
            for (var j = 0; j < exSingleLiterArr.length; j++) {
                singleLiterSum += exSingleLiterArr[i] * exSaleDailyArr[i]
            }
            var kpiCoupons = (-singleLiterSum *activityDays / 1.13) / 1000;
            $("[name=showPageCouponsKPI]").val(kpiCoupons.toFixed(2));
            //换购折扣
            var newDiscount= $("[name=newDiscount]").val(),
                changeDiscount = (-newDiscount / 1.13) / 1000;
            $("[name=showPageChangeDiscount]").val(changeDiscount.toFixed(2))
            //赠品（SP&A)
            var freebiesTotal = $("[name=freebiesTotal]").val(),
                gifts = (-freebiesTotal / 1.13) / 1000;
            $("[name=showPageGiftsKPI]").val(gifts.toFixed(2));
            //宣传等物料投入(SP&A)
            var propaganda=$("[name=propaganda]").val(),
                propagandaKPI=(-propaganda / 1.13) / 1000;
            $("[name=showPagePropagandaKPI]").val(propagandaKPI.toFixed(2));
            //净利润
            $("[name=showPageNetProfitKPI]").val(KPIKRMBKL.toFixed(2));
            //总成本
            var costToatl=0;
            $("[data-tdName=showPageCostChild]").each(function () {
                child = parseFloat($(this).val());
                child = isNaN(child)?0:child;
                costToatl += child
            });
            $("[name=showPageCostTotalKPI]").val(costToatl.toFixed(2));
            //ROI
            var roi = -KPIKRMBKL / costToatl;
            $("[name=showPageROIKPI]").val(roi.toFixed(2))

        }
        //PIR-计算
        function showPagePIR() {
            var acCarDailyArr=[],//活动期-实际活动时日均加油车辆
                acCarTotal=0,//活动期-实际活动时日均加油车辆-总数
                acBeforeCarDailyArr = [],//活动前-实际活动时日均加油车辆
                acAfterCarDailyArr = [],//活动后-实际活动时日均加油车辆
                acBeforeCarTotal=0,//活动前后-实际活动时日均加油车辆-总数
                acSingleOilArr=[],//活动期-实际活动时单车加油量
                acBeforeSingleOilArr=[],//活动前-实际活动时单车加油量
                acAfterSingleOilArr=[],//活动后-实际活动时单车加油量
                PIRActivityCarArr=[],//活动前后日均车辆
                PIRActivityOilArr=[],//活动前后单加
                saleDailyTotal=0,
                noActivityG3Arr=[],//无活动时单升G3
                acSaleDailyArr=[],//活动期-实际活动时日均销量
                acBeforeSaleDailyArr=[],//活动前-实际活动时日均销量
                acAfterSaleDailyArr=[],//活动后-实际活动时日均销量
                straightTotalArr=[],//直降合计
                couponTotalArr=[],//优惠券合计
                PIRallSaleArr=[],//活动全周期日均销量
                noActivitySaleArr=[],//无活动日均销量
                beforeSaleDailyArr=[],//活动前-日均销量
                saleDailyArr=[],//活动期-日均销量
                afterSaleDailyArr=[];//活动后-日均销量

            //活动期-实际活动时日均加油车辆
            $("[data-tdname=actualCar]").each(function () {
                ac = parseFloat($(this).val());
                ac = isNaN(ac)?0:ac;
                acCarDailyArr.push(ac)
            });
            //活动前-实际活动时日均加油车辆
            $("[data-tdname=actualCarBefore]").each(function () {
                acb = parseFloat($(this).val());
                acb = isNaN(acb)?0:acb;
                acBeforeCarDailyArr.push(acb)
            });
            //活动后-实际活动时日均加油车辆
            $("[data-tdname=actualCarAfter]").each(function () {
                aca = parseFloat($(this).val());
                aca = isNaN(aca)?0:aca;
                acAfterCarDailyArr.push(aca)
            });
            //活动期-实际活动时单车加油量
            $("[data-tdname=actualOil]").each(function () {
                ao = parseFloat($(this).val());
                ao = isNaN(ao)?0:ao;
                acSingleOilArr.push(ao)
            });
            //活动前-实际活动时单车加油量
            $("[data-tdname=actualOilBefore]").each(function () {
                aob = parseFloat($(this).val());
                aob = isNaN(aob)?0:aob;
                acBeforeSingleOilArr.push(aob)
            });
            //活动后-实际活动时单车加油量
            $("[data-tdname=actualOilAfter]").each(function () {
                aoa = parseFloat($(this).val());
                aoa = isNaN(aoa)?0:aoa;
                acAfterSingleOilArr.push(aoa)
            });
            //活动期-实际活动日均销量
            $("[data-tdname=actualSales]").each(function () {
                as = parseFloat($(this).val());
                as = isNaN(as)?0:as;
                acSaleDailyArr.push(as)
            });
            //活动前-实际活动日均销量
            $("[data-tdname=actualSalesBefore]").each(function () {
                asb = parseFloat($(this).val());
                asb = isNaN(asb)?0:asb;
                acBeforeSaleDailyArr.push(asb)
            });
            //活动后-实际活动日均销量
            $("[data-tdname=actualSalesAfter]").each(function () {
                asa = parseFloat($(this).val());
                asa = isNaN(asa)?0:asa;
                acAfterSaleDailyArr.push(asa)
            });
            //活动前-日均销量
            $("[data-tdname=avfirst]").each(function () {
                af = parseFloat($(this).val());
                af = isNaN(af)?0:af;
                beforeSaleDailyArr.push(af)
            });
            //活动期-日均销量
            $("[data-tdname=avsecond]").each(function () {
                avs = parseFloat($(this).val());
                avs = isNaN(avs)?0:avs;
                saleDailyArr.push(avs)
            });
            //活动后-日均销量
            $("[data-tdname=avthird]").each(function () {
                avt = parseFloat($(this).val());
                avt = isNaN(avt)?0:avt;
                afterSaleDailyArr.push(avt)
            });
            //无活动时单升G3
            $("[name=showPageNoActivityC3]").each(function () {
                na = parseFloat($(this).val());
                na = isNaN(na)?0:na;
                noActivityG3Arr.push(na)
            });
            //直降合计
            $("[name=straightTotal]").each(function () {
                st = parseFloat($(this).val());
                st = isNaN(st)?0:st;
                straightTotalArr.push(st)
            });
            //优惠券合计
            $("[data-tdname=couponTotal]").each(function () {
                ct = parseFloat($(this).val());
                ct = isNaN(ct)?0:ct;
                couponTotalArr.push(ct)
            });
            //无活动日均销量
            $("[name=showPageNoActivitySale]").each(function () {
                n = parseFloat($(this).val());
                n = isNaN(n)?0:n;
                noActivitySaleArr.push(n)
            });


            //活动期间日均车辆-PIR
            $("[name=showPageCarDailyPIR]").each(function (index) {
                $(this).val(acCarDailyArr[index]);
                acCarTotal += acCarDailyArr[index]
            });
            //活动期间日均车辆-总数-PIR
            $("[name=showPageCarDailyPIRTotal]").val(acCarTotal.toFixed(2));
            //活动前后日均车辆-PIR
            $("[name=showPageBeforeCarDailyPIR]").each(function (index) {
                var val = (acBeforeCarDailyArr[index] * activityBeforeDays + acAfterCarDailyArr[index] * activityAfterDays) / (activityBeforeDays + activityAfterDays);
                val = isNaN(val)?0:val;
                $(this).val(val.toFixed(2));
                PIRActivityCarArr.push(val);
                acBeforeCarTotal += val
            });
            //活动前后日均车辆-总数-PIR
            $("[name=showPageBeforeCarDailyPIRTotal]").val(acBeforeCarTotal.toFixed(2));
            //活动期间单加-PIR
            $("[name=showPageSingleOilPIR]").each(function (index) {
                $(this).val(acSingleOilArr[index])
            });
            //活动前后单加-PIR
            $("[name=showPageBeforeSingleOilPIR]").each(function (index) {
                var val = (acBeforeSingleOilArr[index] * acBeforeCarDailyArr[index] + acAfterSingleOilArr[index] * acAfterCarDailyArr[index]) / (acBeforeCarDailyArr[index] + acAfterCarDailyArr[index])
                val = isNaN(val)?0:val;
                $(this).val(val.toFixed(2));
                PIRActivityOilArr.push(val)
            });
            //活动全周期日均销量-PIR
            $("[name=showPageSaleDailyPIR]").each(function (index) {
                var val = (acCarDailyArr[index] * acSingleOilArr[index] * activityDays + PIRActivityCarArr[index] * PIRActivityOilArr[index] * (activityBeforeDays + activityAfterDays)) / activityAllDays
                $(this).val(val.toFixed(2));
                PIRallSaleArr.push(val);
                saleDailyTotal += val
            });
            //活动全周期日均销量-总量-PIR
            $("[name=showPageSaleDailyPIRToatl]").val(saleDailyTotal.toFixed(2));
            //有活动时单升C3
            $("[name=showPageActivityC3PIR]").each(function (index) {
                var val = (acSaleDailyArr[index] * noActivityG3Arr[index] * activityDays - (straightTotalArr[index] + couponTotalArr[index])) / (acSaleDailyArr[index] * activityDays)
                $(this).val(val.toFixed(2))
            });
            //活动全周期-PIR
            $("[name=showPageAllDaysPIR]").val(activityAllDays);
            //销量贡献KL-0
            var kl0 = (PIRallSaleArr[0] - noActivitySaleArr[0]) * activityAllDays / 1000;
            $("[name=showPageSalesKLPIR0]").val(kl0.toFixed(2));
            //销量贡献KL-92
            var kl92 = (PIRallSaleArr[1] - noActivitySaleArr[1]) * activityAllDays / 1000;
            $("[name=showPageSalesKLPIR92]").val(kl92.toFixed(2));
            //销量贡献KL-95
            var kl95 = (PIRallSaleArr[2] - noActivitySaleArr[2]) * activityAllDays / 1000;
            $("[name=showPageSalesKLPIR95]").val(kl95.toFixed(2));
            //销量贡献KL
            var kl = kl0 + kl92 + kl95;
            $("[name=showPageSalesKLPIR]").val(kl.toFixed(2));
            //c3贡献-0
            var C0 = ((acBeforeSaleDailyArr[0] - beforeSaleDailyArr[0]) * noActivityG3Arr[0] * activityBeforeDays + (acAfterCarDailyArr[0] - afterSaleDailyArr[0]) * noActivityG3Arr[0] * activityAfterDays + (acSaleDailyArr[0] - saleDailyArr[0]) * noActivityG3Arr[0] * activityDays - (straightTotalArr[0] + couponTotalArr[0]) / 1.16) / 1000
            $("[name=showPagePIRKRMB0]").val(C0.toFixed(2));
            //c3贡献-92
            var C92 = ((acBeforeSaleDailyArr[1] - beforeSaleDailyArr[1]) * noActivityG3Arr[1] * activityBeforeDays + (acAfterCarDailyArr[1] - afterSaleDailyArr[1]) * noActivityG3Arr[1] * activityAfterDays + (acSaleDailyArr[1] - saleDailyArr[1]) * noActivityG3Arr[1] * activityDays - (straightTotalArr[1] + couponTotalArr[1]) / 1.16) / 1000
            $("[name=showPagePIRKRMB92]").val(C92.toFixed(2));
            //c3贡献-95
            var C95 = ((acBeforeSaleDailyArr[2] - beforeSaleDailyArr[2]) * noActivityG3Arr[2] * activityBeforeDays + (acAfterCarDailyArr[2] - afterSaleDailyArr[2]) * noActivityG3Arr[2] * activityAfterDays + (acSaleDailyArr[2] - saleDailyArr[2]) * noActivityG3Arr[2] * activityDays - (straightTotalArr[2] + couponTotalArr[2]) / 1.16) / 1000
            $("[name=showPagePIRKRMB95]").val(C95.toFixed(2));
            //c3贡献
            var c3 = C0 + C92 + C95;
            $("[name=showPagePIRKRMBC3]").val(c3.toFixed(2));
            //NFR
            var income=$("[name=changeProductIncome]").val(),
                discount=$("[name=changeProductDiscount]").val();
            var nfr = ((income - discount) / 1.16) / 1000;
            $("[name=showPagePIRNFR]").val(nfr.toFixed(2));
            //直降
            var sumStraightToatl = 0;
            for (var i = 0; i < straightTotalArr.length; i++) {
                sumStraightToatl += straightTotalArr[i]
            }
            var pirStraught = (-sumStraightToatl / activityAllDays / 1.13) / 1000;
            $("[name=showPagePIRStraight]").val(pirStraught.toFixed(2));
            //优惠券
            var sumCoupons=0;
            for (var j = 0; j < couponTotalArr.length; j++) {
                sumCoupons += couponTotalArr[j]
            }
            var pirCoupons = (-sumCoupons / activityAllDays / 1.13) / 1000;
            $("[name=showPagePIRCoupons]").val(pirCoupons.toFixed(2));
            //换购折扣
            var pirChange = (-discount / 1.13) / 1000;
            $("[name=showPagePIRChange]").val(pirChange.toFixed(2));
            //赠品
            var freebiesSum = $("[name=freebiesSum]").val();
            var pirGifts = (-freebiesSum / 1.13) / 1000;
            $("[name=showPagePIRGifts]").val(pirGifts.toFixed(2));
            //宣传等物料投入
            var pro = $("[name=propagandaSPA]").val();
            var pirPro = (-pro / 1.13) / 1000;
            $("[name=showPagePIRPropagandaSPA]").val(pirPro.toFixed(2));
            //净利润
            $("[name=showPagePIRNetProfit]").val(c3.toFixed(2));
            //总成本
            var costSum=0;
            $("[data-tdName=showPagePIRCostChild]").each(function () {
                child = parseFloat($(this).val());
                child = isNaN(child)?0:child;
                costSum += child
            });
            $("[name=showPagePIRTotalCost]").val(costSum.toFixed(2));
            //ROI
            var cost = $("[name=showPagePIRTotalCost]").val();
            var roi = -c3 / cost;
            $("[name=showPagePIRROI]").val(roi.toFixed(2));
        };
        
        //excel -保存
        $("#showPageExcelSave").on("click", function () {
            var ZeroCouponArr = [],//优惠券
                TwoCouponArr = [],
                FiveCouponArr = [],
                ZeroRatioArr = [],
                TwoRatioArr = [],
                FiveRatioArr = [],
                ZeroDisAmountArr = [],
                TwoDisAmountArr = [],
                FiveDisAmountArr = [],
                ZeroDiscountArr = [],
                TwoDiscountArr = [],
                FiveDiscountArr = [],
                ZeroLowOilArr = [],
                TwoLowOilArr = [],
                FiveLowOilArr = [],
                ZeroCounponList = [],
                TwoCounponList = [],
                FiveCounponList = [],
                changeNameArr = [], //换购品
                oldPriceArr = [],
                changePriceArr = [],
                purchasePriceArr = [],
                salesNoArr = [],
                changeSalesArr = [],
                changeSalesNoArr = [],
                RepurchaseArr = [],
                freebiesNameArr = [],//赠品
                freebiesPriceArr = [],
                freebiesExNumberArr = [],
                freebiesCountArr = [],
                GiftArr = [];


            // #0优惠券-最低消费金额
            $("[name=0lowPriceYuan]").each(function () {
                zero = parseFloat($(this).val());
                zero = isNaN(zero)?0:zero;
                ZeroCouponArr.push(zero)
            });
            // #0优惠券-分配比例
            $("[name=0CouponRatio]").each(function () {
                zeroRatio = parseFloat($(this).val());
                zeroRatio = isNaN(zeroRatio)?0:zeroRatio;
                ZeroRatioArr.push(zeroRatio)
            });
            // #0优惠券-优惠金额
            $("[name=0disAmount]").each(function () {
                zeroDis = parseFloat($(this).val());
                zeroDis = isNaN(zeroDis)?0:zeroDis;
                ZeroDisAmountArr.push(zeroDis)
            });
            // #0优惠券-折扣
            $("[name=0discount]").each(function () {
                zeroDisCount = parseFloat($(this).val());
                zeroDisCount = isNaN(zeroDisCount)?0:zeroDisCount;
                ZeroDiscountArr.push(zeroDisCount)
            });
            // #0优惠券-最低单车加油量
            $("[name=0lowOilNumber]").each(function () {
                zeroOil = parseFloat($(this).val());
                zeroOil = isNaN(zeroOil)?0:zeroOil;
                ZeroLowOilArr.push(zeroOil)
            });
            // #92优惠券-最低消费金额
            $("[name=0lowPriceYuan]").each(function () {
                two = parseFloat($(this).val());
                two = isNaN(two)?0:two;
                TwoCouponArr.push(two)
            });
            // #92优惠券-分配比例
            $("[name=92CouponRatio]").each(function () {
                twoRatio = parseFloat($(this).val());
                twoRatio = isNaN(twoRatio)?0:twoRatio;
                TwoRatioArr.push(twoRatio)
            });
            // #92优惠券-优惠金额
            $("[name=92disAmount]").each(function () {
                twoDis = parseFloat($(this).val());
                twoDis = isNaN(twoDis)?0:twoDis;
                TwoDisAmountArr.push(twoDis)
            });
            // #92优惠券-折扣
            $("[name=92discount]").each(function () {
                twoDisCount = parseFloat($(this).val());
                twoDisCount = isNaN(twoDisCount)?0:twoDisCount;
                TwoDiscountArr.push(twoDisCount)
            });
            // #92优惠券-最低单车加油量
            $("[name=92lowOilNumber]").each(function () {
                twoOil = parseFloat($(this).val());
                twoOil = isNaN(twoOil)?0:twoOil;
                TwoLowOilArr.push(twoOil)
            });
            // #95优惠券-最低消费金额
            $("[name=0lowPriceYuan]").each(function () {
                five = parseFloat($(this).val());
                five = isNaN(five)?0:five;
                FiveCouponArr.push(five)
            });
            // #95优惠券-分配比例
            $("[name=95CouponRatio]").each(function () {
                fiveRatio = parseFloat($(this).val());
                fiveRatio = isNaN(fiveRatio)?0:fiveRatio;
                FiveRatioArr.push(fiveRatio)
            });
            // #95优惠券-优惠金额
            $("[name=95disAmount]").each(function () {
                twoDis = parseFloat($(this).val());
                twoDis = isNaN(twoDis)?0:twoDis;
                FiveDisAmountArr.push(twoDis)
            });
            // #95优惠券-折扣
            $("[name=95discount]").each(function () {
                fiveDisCount = parseFloat($(this).val());
                fiveDisCount = isNaN(fiveDisCount)?0:fiveDisCount;
                FiveDiscountArr.push(fiveDisCount)
            });
            // #95优惠券-最低单车加油量
            $("[name=95lowOilNumber]").each(function () {
                fiveOil = parseFloat($(this).val());
                fiveOil = isNaN(fiveOil)?0:fiveOil;
                FiveLowOilArr.push(fiveOil)
            });
            // #0
            for (var i = 0; i < ZeroCouponArr.length; i++) {
                var index = i+1;
                var _obj = {
                    "activityId": acId,
                    "oilCode": "#0",
                    "couponName": "券" + index,//券名称
                    "percentage": ZeroRatioArr[i],//比例
                    "levelPrice": ZeroCouponArr[i],//最低消费金额
                    "discount": ZeroDisAmountArr[i],//优惠金额
                    "sale": ZeroDiscountArr[i],//折扣
                    "levelOilAmount": ZeroLowOilArr[i]//最低单车加油量
                };
                ZeroCounponList.push(_obj)
            }
            // #92
            for (var i = 0; i < TwoCouponArr.length; i++) {
                var index = i+1;
                var _obj = {
                    "activityId": acId,
                    "oilCode": "#92",
                    "couponName": "券" + index,//券名称
                    "percentage": TwoRatioArr[i],//比例
                    "levelPrice": TwoCouponArr[i],//最低消费金额
                    "discount": TwoDisAmountArr[i],//优惠金额
                    "sale": TwoDiscountArr[i],//折扣
                    "levelOilAmount": TwoLowOilArr[i]//最低单车加油量
                };
                TwoCounponList.push(_obj)
            }
            // #95
            for (var i = 0; i < FiveCouponArr.length; i++) {
                var index = i+1;
                var _obj = {
                    "activityId": acId,
                    "oilCode": "#95",
                    "couponName": "券" + index,//券名称
                    "percentage": FiveRatioArr[i],//比例
                    "levelPrice": FiveCouponArr[i],//最低消费金额
                    "discount": FiveDisAmountArr[i],//优惠金额
                    "sale": FiveDiscountArr[i],//折扣
                    "levelOilAmount": FiveLowOilArr[i]//最低单车加油量
                };
                FiveCounponList.push(_obj)
            }

            //换购品
            //名称
            $("[name=changeName]").each(function () {
                cn = $(this).val();
                changeNameArr.push(cn)
            });
            //原售价
            $("[name=oldPrice]").each(function () {
                op = parseFloat($(this).val());
                op = isNaN(op)?0:op;
                oldPriceArr.push(op)
            });
            //换购价
            $("[name=changePrice]").each(function () {
                cp = parseFloat($(this).val());
                cp = isNaN(cp)?0:cp;
                changePriceArr.push(cp)
            });
            //采购价
            $("[name=purchasePrice]").each(function () {
                pp = parseFloat($(this).val());
                pp = isNaN(pp)?0:pp;
                purchasePriceArr.push(pp)
            });
            //无活动销量
            $("[name=salesNo]").each(function () {
                sn = parseFloat($(this).val());
                sn = isNaN(sn)?0:sn;
                salesNoArr.push(sn)
            });
            //参加换购销量
            $("[name=changeSales]").each(function () {
                cs = parseFloat($(this).val());
                cs = isNaN(cs)?0:cs;
                changeSalesArr.push(cs)
            });
            //不参加换购销量
            $("[name=changeSalesNo]").each(function () {
                csn = parseFloat($(this).val());
                csn = isNaN(csn)?0:csn;
                changeSalesNoArr.push(csn)
            });
            for (var j = 0; j < changeNameArr.length; j++) {
                if (changeNameArr[j]) {
                    var _obj = {
                        "activityId": acId,
                        "pdtName": changeNameArr[j],//换购品名称
                        "perPrice": oldPriceArr[j],//原售价
                        "changePrice": changePriceArr[j],//换购价
                        "purchasePrice": purchasePriceArr[j],//采购价
                        "saleAmount": salesNoArr[j],//无活动销量
                        "amount": changeSalesArr[j],//参加换购数量
                        "amountOut": changeSalesNoArr[j],//不参加换购数量
                    };
                    RepurchaseArr.push(_obj)

                }
            }
            //赠品
            //名称
            $("[name=freebiesName]").each(function () {
                fn = $(this).val();
                freebiesNameArr.push(fn)
            });
            //采购价
            $("[name=freebiesPrice]").each(function () {
                fp = parseFloat($(this).val());
                fp = isNaN(fp)?0:fp;
                freebiesPriceArr.push(fp)
            });
            //预计活动期内赠送数量
            $("[name=freebiesExNumber]").each(function () {
                fen = parseFloat($(this).val());
                fen = isNaN(fen)?0:fen;
                freebiesExNumberArr.push(fen)
            });
            //合计
            $("[name=freebiesCount]").each(function () {
                fc = parseFloat($(this).val());
                fc = isNaN(fc)?0:fc;
                freebiesCountArr.push(fc)
            });
            for (var k = 0; k < freebiesNameArr.length; k++) {
                if (freebiesNameArr[k]) {
                    var _obj = {
                        "activityId": acId,
                        "giftName": freebiesNameArr[k],//赠品名称
                        "purchasePrice": freebiesPriceArr[k],//采购价
                        "expectAmount": freebiesExNumberArr[k],//预计活动期内赠送数量
                        "total_price": freebiesCountArr[k]
                    };
                    GiftArr.push(_obj)
                }
            }
            var _params = {
                "applyId": activityString.shellId,
                "shellActivityApply": { //提交主体
                    "id": null,
                    "shellId": activityString.shellId,
                    "shellName": activityString.shellName,
                    "activityName": activityString.activityName,
                    "beginTime": activityString.beginTime,
                    "endTime": activityString.endTime,
                    "activityDays": activityString.activityDays,
                    "activityBeforeDays": activityString.activityBeforeDays,
                    "activityAfterDays": activityString.activityAfterDays,
                    "activityAllDays": activityString.activityAllDays,
                    "giftTotal": $("#giftTotal").val(),//赠品合计金额
                    "addSalePrice": $("#addSalePrice").val(),//换购新增折扣
                    "addInputPrice": $("#addInputPrice").val(),//换购新增收入
                    "baseTotalCar": $("#baseTotalCar").val(),//无活动日均总车辆
                    "baseTotalSale": $("#baseTotalSale").val(),//无活动日均总销量
                    "activityTotalCar": $("#activityTotalCar").val(),//有活动日均总车辆
                    "activityTotalSale": $("#activityTotalSale").val(),//有活动日均总销量
                    "kpiSaleKl": $("#kpiSaleKl").val(),//销量贡献-kpi
                    "kpi0Kl": $("#kpi0Kl").val(),
                    "kpi92Kl": $("#kpi92Kl").val(),
                    "kpi95Kl": $("#kpi95Kl").val(),
                    "kpiSaleC3": $("#kpiSaleC3").val(),//c3贡献-kpi
                    "kpi0C3": $("#kpi0C3").val(),
                    "kpi92C3": $("#kpi92C3").val(),
                    "kpi95C3": $("#kpi95C3").val(),
                    "nfr": $("#nfr").val(),//NFR
                    "directDown": $("#directDown").val(),//直降
                    "coupons": $("#coupons").val(),//优惠券
                    "repurchase": $("#repurchase").val(),//换购
                    "gifts": $("#gifts").val(),//赠品
                    "materielPrice": $("#materielPrice").val(),//宣传物料投入
                    "netProfit": $("#netProfit").val(),//净利润
                    "totalCost": $("#totalCost").val(),//总成本
                    "roi": $("#roi").val()//roi
                },
                "shellActivityApplyOilDtoList": [
                    {
                        "shellActivityApplyOil": {
                            "activityId": acId,
                            "oilCode": "#0",
                            "purchasePrice": $("#0gpPrice").val(), //挂牌价
                            "listedPrice": $("#0cgPrice").val(),//采购价
                            "salePer": $("#0salePer").val(),//无活动单升折扣
                            "profitPer": $("#0profitPer").val(),//无活动单升毛利
                            "materialPrice":$("#materialPrice").val(),//宣传物料投入
                            "expectPerSale": $("#0expectPerSale").val(),//预计单升折扣
                            "oilAmountPer": $("#0oilAmountPer").val(),//单车加油量
                            "actualPerSale": $("#0actualPerSale").val(),//单升折扣
                            "activityPer": $("#0activityPer").val(),//活动参与率
                            "basePerdayCar": $("#0basePerdayCar").val(),//无活动日均车辆
                            "basePerlDay": $("#0basePerlDay").val(),//无活动日均单加
                            "basePersaleA": $("#0basePersaleA").val(),//无活动日均销量
                            "basePerc3Amo": $("#0basePerc3Amo").val(), //无活动单升c3
                            "activityPerdayC": $("#0activityPerdayC").val(),//有活动日均车辆
                            "activityPerlDay": $("#0activityPerlDay").val(),//有活动日均单加
                            "activityPersaleAmount": $("#0activityPersaleAmount").val(),//有活动日均销量
                            "activityPerc3Amount": $("#0activityPerc3Amount").val()//有活动单升C3
                        },
                        "shellActivityApplyCarList": [
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0beforeOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0OilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0afterOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0beforeSaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0SaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0afterSaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0exBeforeCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0exCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0exAfterCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0exBeforeSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0exSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0exAfterSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acBeforeOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acAfterOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acBeforeOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acAfterOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acBeforeSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#0",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=0acAfterSale]").val()//值
                            }
                        ],
                        "shellActivityApplyCouponList": ZeroCounponList
                    },
                    {
                        "shellActivityApplyOil": {
                            "activityId": acId,
                            "oilCode": "#92",
                            "purchasePrice": $("#92gpPrice").val(), //挂牌价
                            "listedPrice": $("#92cgPrice").val(),//采购价
                            "salePer": $("#92salePer").val(),//无活动单升折扣
                            "profitPer": $("#92profitPer").val(),//无活动单升毛利
                            "materialPrice":$("#materialPrice").val(),//宣传物料投入
                            "expectPerSale": $("#92expectPerSale").val(),//预计单升折扣
                            "oilAmountPer": $("#92oilAmountPer").val(),//单车加油量
                            "actualPerSale": $("#92actualPerSale").val(),//单升折扣
                            "activityPer": $("#92activityPer").val(),//活动参与率
                            "basePerdayCar": $("#92basePerdayCar").val(),//无活动日均车辆
                            "basePerlDay": $("#92basePerlDay").val(),//无活动日均单加
                            "basePersaleA": $("#92basePersaleA").val(),//无活动日均销量
                            "basePerc3Amo": $("#92basePerc3Amo").val(), //无活动单升c3
                            "activityPerdayC": $("#92activityPerdayC").val(),//有活动日均车辆
                            "activityPerlDay": $("#92activityPerlDay").val(),//有活动日均单加
                            "activityPersaleAmount": $("#92activityPersaleAmount").val(),//有活动日均销量
                            "activityPerc3Amount": $("#92activityPerc3Amount").val()//有活动单升C3
                        },
                        "shellActivityApplyCarList": [
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92beforeOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92OilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92afterOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92beforeSaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92SaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92afterSaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92exBeforeCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92exCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92exAfterCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92exBeforeSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92exSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92exAfterSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acBeforeOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acAfterOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acBeforeOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acAfterOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acBeforeSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#92",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=92acAfterSale]").val()//值
                            }
                        ],
                        "shellActivityApplyCouponList": TwoCounponList
                    },
                    {
                        "shellActivityApplyOil": {
                            "activityId": acId,
                            "oilCode": "#95",
                            "purchasePrice": $("#95gpPrice").val(), //挂牌价
                            "listedPrice": $("#95cgPrice").val(),//采购价
                            "salePer": $("#95salePer").val(),//无活动单升折扣
                            "profitPer": $("#95profitPer").val(),//无活动单升毛利
                            "materialPrice":$("#materialPrice").val(),//宣传物料投入
                            "expectPerSale": $("#95expectPerSale").val(),//预计单升折扣
                            "oilAmountPer": $("#95oilAmountPer").val(),//单车加油量
                            "actualPerSale": $("#95actualPerSale").val(),//单升折扣
                            "activityPer": $("#95activityPer").val(),//活动参与率
                            "basePerdayCar": $("#95basePerdayCar").val(),//无活动日均车辆
                            "basePerlDay": $("#95basePerlDay").val(),//无活动日均单加
                            "basePersaleA": $("#95basePersaleA").val(),//无活动日均销量
                            "basePerc3Amo": $("#95basePerc3Amo").val(), //无活动单升c3
                            "activityPerdayC": $("#95activityPerdayC").val(),//有活动日均车辆
                            "activityPerlDay": $("#95activityPerlDay").val(),//有活动日均单加
                            "activityPersaleAmount": $("#95activityPersaleAmount").val(),//有活动日均销量
                            "activityPerc3Amount": $("#95activityPerc3Amount").val()//有活动单升C3
                        },
                        "shellActivityApplyCarList": [
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95beforeOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95OilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95afterOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95beforeSaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95SaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AT",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95afterSaleNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95exBeforeCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95exCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95exAfterCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95exBeforeSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95exSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "EX",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95exAfterSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acBeforeOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "CAR",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acAfterOilCar]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acBeforeOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "OIL",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acAfterOilNumber]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "BEFORE",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acBeforeSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "IN",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acSale]").val()//值
                            },
                            {
                                "activityId": acId,
                                "oilCode": "#95",//油品
                                "status": "AFTER",//活动前-BEFORE 中-IN 后-AFTER
                                "type": "AC",//预计-EX/实际-AC/目前-AT
                                "classes": "SALE",//车辆-CAR/油升-OIL/销量-SALE
                                "carValue": $("[data-car=95acAfterSale]").val()//值
                            }
                        ],
                        "shellActivityApplyCouponList": FiveCounponList
                    }
                ],
                "shellActivityApplyGiftList": GiftArr,//赠品
                "shellActivityApplyRepurchaseList": RepurchaseArr//换购品
            };
            var dataString = JSON.stringify(_params);
            febs.post(ctx + 'shellActivityApply/shellActivityApplyDetailAdd', { "jsonApply": dataString } , function () {
                febs.alert.success('操作成功');
            });
        });
        //活动详情获取
        function getContentInfo() {
            febs.get(ctx + 'shellActivityApply/shellActivityApplyDetail', { "id": actID} , function (res) {
                    console.log(res);
                    if (res.data.shellActivityApply){
                        activityString = res.data.shellActivityApply;
                        activityDays = activityString.activityDays;
                        activityBeforeDays = activityString.activityBeforeDays;
                        activityAfterDays = activityString.activityAfterDays;
                        activityAllDays = activityString.activityAllDays;
                        //活动前-日期
                        $("[data-tdName=beforeAcName]").each(function () {
                            $(this).html("活动前"+activityString.beginTime+"-"+activityString.endTime)
                        });
                        //活动期-日期
                        $("[data-tdName=AcName]").each(function () {
                            $(this).html("活动期"+activityString.beginTime+"-"+activityString.endTime)
                        });
                        //活动后-日期
                        $("[data-tdName=afterAcName]").each(function () {
                            $(this).html("活动后"+activityString.beginTime+"-"+activityString.endTime)
                        });
                        //主体
                        $("#giftTotal").val(res.data.shellActivityApply.giftTotal);//赠品合计金额
                        $("#addSalePrice").val(res.data.shellActivityApply.addSalePrice);//换购新增折扣
                        $("#addInputPrice").val(res.data.shellActivityApply.addInputPrice);//换购新增收入
                        $("#baseTotalCar").val(res.data.shellActivityApply.baseTotalCar);//无活动日均总车辆
                        $("#baseTotalSale").val(res.data.shellActivityApply.baseTotalSale);//无活动日均总销量
                        $("#activityTotalCar").val(res.data.shellActivityApply.activityTotalCar);//有活动日均总车辆
                        $("#activityTotalSale").val(res.data.shellActivityApply.activityTotalSale);//有活动日均总销量
                        $("#kpiSaleKl").val(res.data.shellActivityApply.kpiSaleKl);//销量贡献-kpi
                        $("#kpi0Kl").val(res.data.shellActivityApply.kpi0Kl);
                        $("#kpi92Kl").val(res.data.shellActivityApply.kpi92Kl);
                        $("#kpi95Kl").val(res.data.shellActivityApply.kpi95Kl);
                        $("#kpiSaleC3").val(res.data.shellActivityApply.kpiSaleC3);//c3贡献-kpi
                        $("#kpi0C3").val(res.data.shellActivityApply.kpi0C3);
                        $("#kpi92C3").val(res.data.shellActivityApply.kpi92C3);
                        $("#kpi95C3").val(res.data.shellActivityApply.kpi95C3);
                        $("#nfr").val(res.data.shellActivityApply.nfr);//NFR
                        $("#directDown").val(res.data.shellActivityApply.directDown);//直降
                        $("#coupons").val(res.data.shellActivityApply.coupons);//优惠券
                        $("#repurchase").val(res.data.shellActivityApply.repurchase);//换购
                        $("#gifts").val(res.data.shellActivityApply.gifts);//赠品
                        $("#materielPrice").val(res.data.shellActivityApply.materielPrice);//宣传物料投入
                        $("#netProfit").val(res.data.shellActivityApply.netProfit);//净利润
                        $("#totalCost").val(res.data.shellActivityApply.totalCost);//总成本
                        $("#roi").val(res.data.shellActivityApply.roi);//roi
                    } 
                    if (res.data.shellActivityApplyOilDtoList.length > 0) {
                        //油品-0
                        $("#0gpPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.purchasePrice);//挂牌价
                        $("#0cgPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.listedPrice);//采购价
                        $("#0salePer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.salePer);//无活动单升折扣
                        $("#0profitPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.profitPer);//无活动单升毛利
                        $("#materialPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.materialPrice);//宣传物料投入
                        $("#0expectPerSale").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.expectPerSale);//预计单升折扣
                        $("#0oilAmountPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.oilAmountPer);//单车加油量
                        $("#0actualPerSale").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.actualPerSale);//单升折扣
                        $("#0activityPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.activityPer);//活动参与率
                        $("#0basePerdayCar").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.basePerdayCar);//无活动日均车辆
                        $("#0basePerlDay").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.basePerlDay);//无活动日均单加
                        $("#0basePersaleA").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.basePersaleA);//无活动日均销量
                        $("#0basePerc3Amo").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.basePerc3Amo); //无活动单升c3
                        $("#0activityPerdayC").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.activityPerdayC);//有活动日均车辆
                        $("#0activityPerlDay").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.activityPerlDay);//有活动日均单加
                        $("#0activityPersaleAmount").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.activityPersaleAmount);//有活动日均销量
                        $("#0activityPerc3Amount").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyOil.activityPerc3Amount);//有活动单升C3
                        // 油品-0-car
                        var zeroCarList = res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyCarList.slice(-21);
                        $("[data-returnVal=0oilCar]").each(function (index) {
                           $(this).val(zeroCarList[index].carValue)
                        });
                        // 油品-0-券
                        var  zeroCouponList = res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 3].shellActivityApplyCouponList.slice(-8);
                        $("[name=0CouponRatio]").each(function (index) {
                            $(this).val(zeroCouponList[index].percentage)
                        });
                        $("[name=0lowPriceYuan]").each(function (index) {
                            $(this).val(zeroCouponList[index].levelPrice)
                        });
                        $("[name=0disAmount]").each(function (index) {
                            $(this).val(zeroCouponList[index].discount)
                        });
                        $("[name=0discount]").each(function (index) {
                            $(this).val(zeroCouponList[index].sale)
                        });
                        $("[name=0lowOilNumber]").each(function (index) {
                            $(this).val(zeroCouponList[index].levelOilAmount)
                        });

                        //油品-#92
                        $("#92gpPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.purchasePrice);//挂牌价
                        $("#92cgPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.listedPrice);//采购价
                        $("#92salePer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.salePer);//无活动单升折扣
                        $("#92profitPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.profitPer);//无活动单升毛利
                        $("#materialPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.materialPrice);//宣传物料投入
                        $("#92expectPerSale").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.expectPerSale);//预计单升折扣
                        $("#92oilAmountPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.oilAmountPer);//单车加油量
                        $("#92actualPerSale").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.actualPerSale);//单升折扣
                        $("#92activityPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.activityPer);//活动参与率
                        $("#92basePerdayCar").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.basePerdayCar);//无活动日均车辆
                        $("#92basePerlDay").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.basePerlDay);//无活动日均单加
                        $("#92basePersaleA").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.basePersaleA);//无活动日均销量
                        $("#92basePerc3Amo").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.basePerc3Amo); //无活动单升c3
                        $("#92activityPerdayC").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.activityPerdayC);//有活动日均车辆
                        $("#92activityPerlDay").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.activityPerlDay);//有活动日均单加
                        $("#92activityPersaleAmount").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.activityPersaleAmount);//有活动日均销量
                        $("#92activityPerc3Amount").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyOil.activityPerc3Amount);//有活动单升C3
                        // 油品-#92-car
                        var twoCarList = res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyCarList.slice(-21);
                        $("[data-returnVal=92oilCar]").each(function (index) {
                            $(this).val(twoCarList[index].carValue)
                        });
                        // 油品-92-券
                        var  twoCouponList = res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 2].shellActivityApplyCouponList.slice(-8);
                        $("[name=92CouponRatio]").each(function (index) {
                            $(this).val(twoCouponList[index].percentage)
                        });
                        $("[name=92lowPriceYuan]").each(function (index) {
                            $(this).val(twoCouponList[index].levelPrice)
                        });
                        $("[name=92disAmount]").each(function (index) {
                            $(this).val(twoCouponList[index].discount)
                        });
                        $("[name=92discount]").each(function (index) {
                            $(this).val(twoCouponList[index].sale)
                        });
                        $("[name=92lowOilNumber]").each(function (index) {
                            $(this).val(twoCouponList[index].levelOilAmount)
                        });

                        //油品-#95
                        $("#95gpPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.purchasePrice);//挂牌价
                        $("#95cgPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.listedPrice);//采购价
                        $("#95salePer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.salePer);//无活动单升折扣
                        $("#95profitPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.profitPer);//无活动单升毛利
                        $("#materialPrice").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.materialPrice);//宣传物料投入
                        $("#95expectPerSale").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.expectPerSale);//预计单升折扣
                        $("#95oilAmountPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.oilAmountPer);//单车加油量
                        $("#95actualPerSale").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.actualPerSale);//单升折扣
                        $("#95activityPer").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.activityPer);//活动参与率
                        $("#95basePerdayCar").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.basePerdayCar);//无活动日均车辆
                        $("#95basePerlDay").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.basePerlDay);//无活动日均单加
                        $("#95basePersaleA").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.basePersaleA);//无活动日均销量
                        $("#95basePerc3Amo").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.basePerc3Amo); //无活动单升c3
                        $("#95activityPerdayC").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.activityPerdayC);//有活动日均车辆
                        $("#95activityPerlDay").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.activityPerlDay);//有活动日均单加
                        $("#95activityPersaleAmount").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.activityPersaleAmount);//有活动日均销量
                        $("#95activityPerc3Amount").val(res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyOil.activityPerc3Amount);//有活动单升C3
                        //油品-#95-car
                        var fiveCarList = res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyCarList.slice(-21);
                        $("[data-returnVal=95oilCar]").each(function (index) {
                            $(this).val(fiveCarList[index].carValue)
                        });
                        // 油品-95-券
                        var  fiveCouponList = res.data.shellActivityApplyOilDtoList[res.data.shellActivityApplyOilDtoList.length - 1].shellActivityApplyCouponList.slice(-8);
                        $("[name=92CouponRatio]").each(function (index) {
                            $(this).val(fiveCouponList[index].percentage)
                        });
                        $("[name=95lowPriceYuan]").each(function (index) {
                            $(this).val(fiveCouponList[index].levelPrice)
                        });
                        $("[name=95disAmount]").each(function (index) {
                            $(this).val(fiveCouponList[index].discount)
                        });
                        $("[name=95discount]").each(function (index) {
                            $(this).val(fiveCouponList[index].sale)
                        });
                        $("[name=95lowOilNumber]").each(function (index) {
                            $(this).val(fiveCouponList[index].levelOilAmount)
                        });
                    }
                    if (res.data.shellActivityApplyGiftList.length > 0) {
                        $("[name=freebiesName]").each(function (index) {
                            if (res.data.shellActivityApplyGiftList[index]) {
                                $(this).val(res.data.shellActivityApplyGiftList[index].giftName)
                            }
                        });
                        $("[name=freebiesPrice]").each(function (index) {
                            if (res.data.shellActivityApplyGiftList[index]) {
                                $(this).val(res.data.shellActivityApplyGiftList[index].purchasePrice)
                            }
                        });
                        $("[name=freebiesExNumber]").each(function (index) {
                            if (res.data.shellActivityApplyGiftList[index]) {
                                $(this).val(res.data.shellActivityApplyGiftList[index].expectAmount)
                            }
                        });
                        $("[name=freebiesCount]").each(function (index) {
                            if (res.data.shellActivityApplyGiftList[index]) {
                                $(this).val(res.data.shellActivityApplyGiftList[index].total_price)
                            }
                        });
                    }
                    if (res.data.shellActivityApplyRepurchaseList.length > 0) {
                        $("[name=changeName]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].pdtName)
                            }
                        });
                        $("[name=oldPrice]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].perPrice)
                            }
                        });
                        $("[name=changePrice]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].changePrice)
                            }
                        });
                        $("[name=purchasePrice]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].purchasePrice)
                            }
                        });
                        $("[name=salesNo]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].saleAmount)
                            }
                        });
                        $("[name=changeSales]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].amount)
                            }
                        });
                        $("[name=changeSalesNo]").each(function (index) {
                            if (res.data.shellActivityApplyRepurchaseList[index]) {
                                $(this).val(res.data.shellActivityApplyRepurchaseList[index].amountOut)
                            }
                        });
                    }

            });
        }
    });
</script>